Lisong's Blog


一月 7th, 2009

ASP常用自定义函数--CutStr

Learning, by 木公.
Function CutStr(byVal Str,byVal StrLen)
	Dim l,t,c,i
	l=Len(str)
	t=0
	For i=1 To l
		c=AscW(Mid(str,i,1))
		If c<0 Or c>255 Then t=t+2 Else t=t+1
		IF t>=StrLen Then
			CutStr=left(Str,i)&"..."
			Exit For
		Else
			CutStr=Str
		End If
	Next
End Function

CutStr("ASP常用自定义函数--CutStr",5)
显示:“ASP常用...”

Back Top

回复自“ASP常用自定义函数--CutStr”

评论 (2) 引用 (0) 发表评论 引用地址
  1. 看不懂的函数,。真不好意思。

  2. Set your own life more easy take the loans and everything you need.

  1. 没有任何引用。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*


无觅相关文章插件,快速提升流量