我看到这个问题是很久以前提出的,我想你现在已经找到了答案。无论如何,这就是我目前正在做的事情。我查找要替换的特定字符,然后在另一个数组中放置我希望将它们更改为的字符。我希望这对你有用。
Private Function CleanText(TextToClean As String) As String
Dim CleanedText As String = TextToClean
Dim BadText(5) As Char
Dim GoodText(5) As String
BadText(0) = ChrW(169) ' © (alt 0169, copyright)
BadText(1) = ChrW(174) ' ® (alt 0174, registered trademark)
BadText(2) = ChrW(8482) ' ™ (alt 0153, trademark)
BadText(3) = ChrW(8364) ' € (alt 0128, Euro)
BadText(4) = ChrW(176) ' ° (alt 0176, degrees)
GoodText(0) = "(c)"
GoodText(1) = "(r)"
GoodText(2) = "(tm)"
GoodText(3) = "(euro)"
GoodText(4) = "o"
For i As Integer = 0 To BadText.GetUpperBound(0)
CleanedText = CleanedText.Replace(BadText(i), GoodText(i))
Next
Return CleanedText
End Function