ASP字数计算函数
2004-01-13 10:27:10 来源:WEB开发网核心提示:<%'asp字数计算函数Function WordCount(strInput) Dim strTemp strTemp = Replace(strInput, vbTab, " ") strTemp = Replace(strTemp, vbCr, " ")
<%
'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
%>
[]
更多精彩
赞助商链接