特色栏目

ASP源码

PHP源码

.NET源码

JSP源码

游戏频道
专题合集
关闭菜单
首页> ASP教程> ASP字数计算函数

ASP字数计算函数

时间:2009-06-24 16:47:51 作者:互联网

<%
'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
%>

 

相关文章 最新文章

相关应用

热门文章

猜你喜欢

返回顶部