Following Code:

string a = "Adding substring" + "\xB2";
Console.Write(a);

Will give : "Adding substring2". 2 will be superscript as expected.

How can I do the same with number 3.

有帮助吗?

解决方案

Just replace 2 with 3 in "\xB2"

string a = "Adding substring" + "\xB3";
Console.Write(a);

And you will get:

Adding substring³

其他提示

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top