如果我有一个str=1,2,3,4,5 如何用ASP函数处理成str='1','2','3','4','5' 高手们帮帮忙
楼上正解
str = "1,2,3,4,5"
NewStr = ""
For k = 0 To UBound(Split(str,","))
CutStr = Split(str,",")(k)
EndStr = ","
If k = UBound(Split(str,",")) Then
EndStr = ""
End if
NewStr = NewStr &"'"&CutStr&"'"&EndStr
Next
<%response.write "'"&replace(str,",","','")&"'"%>
看了下别人的回答发现我写的有点笨
这么写不错。
str = "'"& replace(str,",","','")&"'"
学习了。