niao
niao

Reputation: 5070

Changing Unicode character to string

I have to following string:

Dim text As String = "user̲upload"

I want to change the Unicode character @0332 to underscore. I have the following code for this:

Dim test As New Text.StringBuilder
test.Append(text.Replace("@0332", "_"))
Dim normalizedUrl As String = test.ToString()

However it does not work, my "test" string has the same value as "text" variable. Anyone has an idea what can be wrong?

Upvotes: 2

Views: 1650

Answers (1)

Alex K.
Alex K.

Reputation: 175766

You can;

text.Replace(ChrW(&H332), "_")

Upvotes: 2

Related Questions