明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

ASP字?jǐn)?shù)計(jì)算函數(shù)

[摘要]<%'ASP字?jǐn)?shù)計(jì)算函數(shù)Function WordCount(strInput) Dim strTemp strTemp = Replace(strInput, vbTab...

<%
'ASP字?jǐn)?shù)計(jì)算函數(shù)
Function WordCount(strInput)
    Dim strTemp
    strTemp = Replace(strInput, vbTab, " ")
    strTemp = Replace(strTemp, vbCr, " ")
    strTemp = Replace(strTemp, vbLf, " ")

    ' 刪除字首字尾空格
    strTemp = Trim(strTemp)

    ' 替換為一個(gè)空格
    Do While InStr(1, strTemp, "  ", 1) <> 0
        strTemp = Replace(strTemp, "  ", " ")
    Loop
WordCount = UBound(Split(strTemp, " ", -1, 1)) +1
End Function
%>