internal static void UnicodeSupportExample() { string normalText = "1234567890-+"; Console.OutputEncoding = System.Text.Encoding.UTF8; string superscriptText = UnicodeSupport.GetSuperscriptText(normalText); Console.WriteLine("Superscript version of '" + normalText + "' = '" + superscriptText + "'"); // Result: "Superscript version of '1234567890-+' = '¹²³⁴⁵⁶⁷⁸⁹⁰⁻⁺'" Console.WriteLine("Superscript version of x2 = " + UnicodeSupport.GetSuperscriptText("x2")); // Result: "Superscript version of x2 = x²" string subscriptText = UnicodeSupport.GetSubscriptText(normalText); Console.WriteLine("Subscript version of '" + normalText + "' = '" + subscriptText + "'"); // Result: "Subscript version of '1234567890-+' = '₁₂₃₄₅₆₇₈₉₀₋₊'" Console.WriteLine("Subscript version of H2O = " + UnicodeSupport.GetSubscriptText("H2O")); // Result: "Subscript version of H2O = H₂O" }
public void GetSubscriptTextTest() { Assert.Equal(subscripts, UnicodeSupport.GetSubscriptText(normal)); }