I have this string:
Dim stringToCleanUp As String = "bon;jour"
Dim characterToRemove As String = ";"
I want a function who removes the ';' character like this:
Function RemoveCharacter(ByVal stringToCleanUp, ByVal characterToRemove)
...
End Function
What would be the function ?
ANSWER:
Dim cleanString As String = Replace(stringToCleanUp, characterToRemove, "")
Great, Thanks!
You can use the string.replace method
string.replace("character to be removed", "character to be replaced with")
The
string
class'sReplace
method can also be used to remove multiple characters from a string:Here's more information about VB's Replace function
The
String
class has aReplace
method that will do that.