2

I'm looking for a possibility to write a label text for cubic meters where the 3 is written as an exponent to m. For example:

mylabel.Text="m3";

Is it possible to write the 3 as an exponent? How should I do it?

3 Answers3

1

Something like

mylabel.Text = "m" + "\u00B3";
Dutts
  • 5,781
  • 3
  • 39
  • 61
1

You don't have to escape your Unicode characters in strings as C# is inherently Unicode. Just put your Unicode characters as they are into the string. For example:

mylabel.Text = "m³";
Dor Lugasi-Gal
  • 1,430
  • 13
  • 35
1

I don't think there is a exact or proper way of doing this. But one way you can do this is by entering the digit that you want to be a exponent into this website https://lingojam.com/SuperscriptGenerator.

And then copy the converted version. So for your example I put a 3 in there, and the converted version I got was ³. Then you just connect it together.

Now you can just add it to the label...

mylabel.Text="m³";
Prabhdeep Singh
  • 176
  • 1
  • 16