Instr,Trim,Left,Right等函数的命名空间

hornbills hornbills 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Imports System
Imports System.String
Namespace Yifang
public class TextFromDB
'只取第一行或者而且不超过20个字符
Public Function ToTitle(strSource as String)
Dim strResult as String
strResult=Trim(strSource)
If InStr(strResult,CHR(13))>0 then
strResult=Left(strResult,InStr(strSource,CHR(13)))
End If
If strResult.Length>20 Then
strResult=strResult.Substring(0,20)+"…"
End If
Return strResult
End Function
End class
End Namespace

不行!
...全文

相关推荐

评论 13
收藏 已收藏
分享
返回顶部
hornbills
.NET社区 62,272 成员 668,968 内容