Convert a Unicode string to an escaped ASCII string

前端 未结 9 1421
广开言路
广开言路 2020-11-22 04:00

How can I convert this string:

This string contains the Unicode character Pi(π)

into an escaped A

9条回答
  •  悲&欢浪女
    2020-11-22 04:37

    For Unescape You can simply use this functions:

    System.Text.RegularExpressions.Regex.Unescape(string)
    
    System.Uri.UnescapeDataString(string)
    

    I suggest using this method (It works better with UTF-8):

    UnescapeDataString(string)
    

提交回复
热议问题