Is there a built in .NET function or an easy way to convert from:
"01234"
to:
"\u2070\u00B9\u00B2\u00B3\u2074"
Note that superscript 1, 2 and 3 are not in the range \u2070-\u209F but \u0080-\u00FF.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EDIT: I hadn’t noticed that the superscript characters weren’t as simple as
\u2070–\u2079. You probably want to set up a mapping between characters. If you only need digits, you could just index into a string fairly easily:Then using LINQ:
Or without: