怎样删除指定字符
例如:有一个字符串
str="1,6,10,20,15,100,8,9"
要删除str字符串中为10的字符,结果为:
"1,6,10,20,15,8,9"
感谢!
Dim Arr() As String Str1 = "1,6,10,20,15,100,8,9" Str2 = "" Arr = Split(Str1, ",") For Each a In Arr If Not a = "100" Then Str2 = Str2 + a + "," End If Next Str2 = Mid(Str2, 1, Len(Str2) - 1)
Str2 = "" Str2 = Replace(str1, "100,", "")
[此贴子已经被作者于2020-11-10 12:53编辑过]