繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> 截字符串

截字符串

2006-09-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:  '**************************************************'''' '函数ID:0001[截字符串] '函数名:SubstZFC '作 用:截字符串,汉字一个算两个字符,英文算一个字符 '参 数:str ----原字符串 ' strl...
关键字:字符串

  '**************************************************''''

'函数ID:0001[截字符串]

'函数名:SubstZFC

'作 用:截字符串,汉字一个算两个字符,英文算一个字符

'参 数:str ----原字符串

' strlen ----截取长度

'返回值:截取后的字符串

'**************************************************

Public Function SubstZFC(ByVal str, ByVal strlen)

If str = "" Then

SubstZFC = ""

Exit Function

End If

Dim l, t, c, i, strTemp

str = Replace(Replace(Replace(Replace(str, " ", " "), """, Chr(34)), ">", ">"), "<", " 255 Then

t = t + 2

Else

t = t + 1

End If

If t >= strlen Then

strTemp = Left(str, i)

Exit For

End If

Next

SubstZFC = Replace(Replace(Replace(Replace(strTemp, " ", " "), Chr(34), """), ">", ">"), "<", "<")

End Function

责任编辑:admin
相关文章