当前位置: 代码迷 >> ASP >> 对一个规则字符串进行替换操作,该怎么解决
  详细解决方案

对一个规则字符串进行替换操作,该怎么解决

热度:87   发布时间:2012-03-26 15:46:56.0
对一个规则字符串进行替换操作
a2,b5,h2,k9,

替换成
plo*2|ver*5|thlik*2|poor*9

就是说a替换成plo*,以此类推

------解决方案--------------------
strA = "a2,b5,h2,k9 " '如果最后有一个“,”那么最好去掉。
arrA = split(strA, ", ")
for i = 0 to ubound(arrA)
if left(arrA(i),1)= "a " then
strTemp = strTemp & "plo* "&right(arrA(i),1)
if i <> ubound(arrA)
strTemp = strTemp & "| "
end if
elseif
'自己去写各种情况
end if
next
Response.write strTemp
  相关解决方案