ASP字数计算函数,ASP字数计算函数
【 tulaoshi.com - ASP 】
<%
'ASP字数计算函数
Function WordCount(strInput)
Dim strTemp
strTemp = Replace(strInput, vbTab, " ")
strTemp = Replace(strTemp, vbCr, " ")
strTemp = Replace(strTemp, vbLf, " ")
' 删除字首字尾空格
strTemp = Trim(strTemp)
' 替换为一个空格
Do While InStr(1, strTemp, " ", 1) < 0
strTemp = Replace(strTemp, " ", " ")
Loop
WordCount = UBound(Split(strTemp, " ", -1, 1)) +1
End Function
%
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/asp/)
来源:http://www.tulaoshi.com/n/20160129/1506847.html