Chase R Lewis
Chase R Lewis

Reputation: 2307

Parse string for unicode characters in C#

I have an input form where someone is allowed to type unicode characters. So it might be something like "Hey \uF32A what's up?". If I get this string it will have a substring of "\uF32A" how do i turn that to the character '\uF32A'?

Upvotes: 2

Views: 660

Answers (1)

Abhishek
Abhishek

Reputation: 2945

Use Regular Expression to Unescape as shown below:

var str = @"Hey \uF32A what's up?";    
System.Text.RegularExpressions.Regex.Unescape(str);

Upvotes: 1

Related Questions