<%
dim id_array(20)
dim total_id
total_id=0
Sub InterceptString(txt,str)
txt=trim(txt)
x = len(txt)
y = 0
tempStr=""
if x >= 1 then
for ii = 1 to x
if mid(txt,ii,1)=str then
id_array(y)=tempStr
y=y+1
tempStr=""
else
tempStr=tempStr+mid(txt,ii,1)
end if
next
end if
id_array(y)=tempStr
total_id=y
End Sub
%>
本文介绍了一种使用VBScript进行文本字符串处理的方法,通过自定义函数SubInterceptString实现了基于指定字符对文本进行分割的功能。该方法适用于需要按特定符号切割字符串的应用场景,如配置文件解析或简单的数据处理任务。

被折叠的 条评论
为什么被折叠?



