更新时间:2023-02-12 18:38:46
您可以使用数组并在其元素上循环:
You could use an array and loop over its elements:
Sub MAIN()
Dim s As String
s = "123456qwerty"
junk = Array("q", "w", "e", "r", "t", "y")
For Each a In junk
s = Replace(s, a, "")
Next a
MsgBox s
End Sub
每个垃圾元素可以是子字符串或单个字符.
Each element of junk can be either a sub-string or a single character.