日期:2014-05-16 浏览次数:20967 次
Dim strValue
Dim intACnt
Dim intBCnt
strValue = "AABABBBBBABBBBAAAAAABABBABABABABBAABABABABBBABABABA"
intACnt = Len(strValue) - Len(Replace(strValue, "A", ""))
intBCnt = Len(strValue) - intACnt
Response.Write "A的出现次数=“ & CStr(intACnt) & "<br />"
Response.Write "A的出现次数=“ & CStr(intBCnt) & "<br />"
strValue = "AABABBBBBABBBBAAAAAABABBABABABABBAABABABABBBABABABA"
ar = split(strValue, "B")
b_counter = ubound(ar)
a_counter = len(strValue)-b_counter
Response.Write "A的出现次数=“ & CStr(a_counter) & "<br />"
Response.Write "B的出现次数=“ & CStr(b_counter) & "<br />"
Dim str
str="AABABBBBBABBBBAAAAAABABBABABABABBAABABABABBBABABABA"
Response.Write "A的出现次数="& UBound(Split(str,"A")) & "<br />"
Response.Write "B的出现次数="& UBound(Split(str,"B")) & "<br />"