1
我希望將字符串「123」轉換爲像「\ u0031 \ u0032 \ u0033 \ u0033」這樣的字符串。我怎樣才能在.NET中做到這一點? 例如:反向轉換:將字符串轉換爲us-ascii in c#
Encoding enc = Encoding.GetEncoding("us-ascii",
new EncoderExceptionFallback(),
new DecoderExceptionFallback());
byte[] by = enc.GetBytes(s);
string ans = enc.GetString(by);
return ans;