|
如果是你给定的字符串,有多个办法来处理,其中之一,仅供参考:
- <%
- Dim intCounter
- Dim strTest, strKeyWord
- strKeyWord="碎"
- strTest="碎片,无,碎片一,无,碎片二"
- '//指定关键词出现次数
- intCounter=ubound(split(strTest,strKeyWord))
-
- Response.Write("关键词【"&strKeyWord&"】在测试字符串【"&strTest&"】中:")
-
- Select Case intCounter
- Case 1
- Response.Write "出现1次"
- Case 2
- Response.Write "出现2次"
- Case 3
- Response.Write "出现3次"
- Case else
- Response.Write "未发现指定关键词"
- End Select
-
- %>
复制代码
|
|