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:
const string SuperscriptDigits =
"u2070u00b9u00b2u00b3u2074u2075u2076u2077u2078u2079";
Then using LINQ:
string superscript = new string(text.Select(x => SuperscriptDigits[x - '0'])
.ToArray());
Or without:
char[] chars = text.ToArray();
for (int i = 0; i < chars.Length; i++)
{
chars[i] = SuperscriptDigits[chars[i] - '0'];
}
string superscript = new string(chars);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…