我有这个字符串:
Dim stringToCleanUp As String = "bon;jour" Dim characterToRemove As String = ";"@H_502_2@Function RemoveCharacter(ByVal stringToCleanUp,ByVal characterToRemove) ... End Function@H_502_2@这是什么功能?
回答:
Dim cleanString As String = Replace(stringToCleanUp,characterToRemove,"")@H_502_2@万分感谢!
Function RemoveCharacter(ByVal stringToCleanUp,ByVal characterToRemove) ' replace the target with nothing ' Replace() returns a new String and does not modify the current one Return stringToCleanUp.Replace(characterToRemove,"") End Function@H_502_2@这里有更多关于VB’s Replace function的信息