How do I show a to the power 2 in the string.format?
analysis = String.Format("\nFormula: a^2 + b^2 = c^2");
Instead of a^2, I would like to show the same way as shown on the HTML page.
<strong>Formula: a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></strong>
String.Format doesn't support converting characters to superscript. You'll need to find the correct characters yourself and pass those to String.Format.
See this answer for ways to do that.
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