Instr,Trim,Left,Right等函数的命名空间
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
不行!