I have not found it anywhere so I am asking. How can I write string with upper index? Prefferably in resources. For example I want write square meters as m2 where 2 is upper index.
Thanks
If it is only for ² and ³: Those are available at UTF 00B2 resp. 00B3 so you can just use the entity notation: The area is 2 m\u00B2.
. Or use the character directly, if your keyboard supports it or copy and paste it into the file.
try this
M<sup>2</sup>
or you can use textview.setText(Html.fromHtml("M<sup>2</sup>"));
Edited:
This is my string.xml
<string name="hello">Hello World<sup>2</sup></string>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With