在VB中,可以使用Replace方法来去掉字符串中的某个字符。具体语法如下:
Dim result As String = originalString.Replace(characterToRemove, "")
其中,originalString表示原始字符串,characterToRemove表示要去掉的字符,result即为去掉字符后的新字符串。
以下是一个完整的示例:
Dim originalString As String = "Hello, World!"
Dim characterToRemove As String = ","
Dim result As String = originalString.Replace(characterToRemove, "")
Console.WriteLine(result)
输出结果为:“Hello World!”