How to set superscript in a string in C #

Source: Internet
Author: User

One, in HTML:
If the string "21st" wants to set St as superscript, in the HTML tag is 21<sup>st</sup>

Second, the C # Editor
You can use Unicode super/subscripts, such as:
var " O? ";       // or "o\x2082" var " unit² " // or "Unit\xb2"

Please refer to the table in the following URL: https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts

The most common superscript digits (1, 2, and 3) were in iso-8859-1 and were therefore carried over into those positions I n the Latin-1 range of Unicode. The rest were placed in a dedicated sections of Unicode at u+2070 to u+209f. The tables below show these characters. Each superscript or subscript character are preceded by a normal x to show the subscripting/superscripting. The table on the left contains the actual Unicode characters; The one on the right contains the equivalents using HTML markup for the subscript or superscript. Gray cells is reserved for the future use, white cells is other characters from Latin-1.

You can also directly copy the characters inside the program to modify it.

Unicode characters
0 1 2 3 4 5 6 7 8 9 A B C D E F
U+00bx x ²
u+207x X? X? X? X? X? X? X? X? X? X? X? X? X? X?
u+208x X? X? X? X? X? X? X? X? X? X? X? X? X? X? X?
U+209x X? X? X? X? X? X? X? X? X? X? X? X? X?
equivalent HTML markup
0 1 2 3 4 5 6 7 8 9 A B C D E F
U+00bx X2 X3 X1
u+207x X0 Xi X4 X5 X6 X7 x8 X9 x+ X− x= X X Xn
u+208x X0 X1 X2 X3 X4 X5 X6 X7 x8 X9 x+ X− x= X X
U+209x Xa Xe Xo Xx X? Xh Xk Xl Xm Xn Xp Xs Xt

Other superscript and subscript characters

Unicode also includes subscript and superscript characters that is intended for semantic usage, in the following blocks:

  • The Latin-1 Supplement block contains the feminine and masculine ordinal indicatorsªandº.
  • The combining diacritical Marks block contains medieval superscript letter diacritics. These letters is written directly above other letters appearing in medieval Germanic manuscripts, and so these glyphs do Not include spacing, for example U?. They is shown here over a long string of periods: ...? ...? ...? ...? ...? ...? ...? ...? ...? ...? ...? ...? ...?..
  • The combining diacritical Marks Supplement block contains additional medieval superscript letter diacritics, enough to COM Plete the basic lowercase Latin alphabet except for Q and Y, a few small capitals and ligatures (AE, AO, AV), and addition Al Letters.
  • The Spacing Modifier Letters block have superscripted Letters and symbols used for phonetic transcription:???????? ? ? ? ? ? ? ? ?.
  • The Phonetic Extensions block has several sub-and super-scripted letters and symbols:?????????????????????????????? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.
  • The Phonetic Extensions Supplement block have a few more:??????????????????????????????????????????????????? ? ? ? ? ?.

Consolidated, the Unicode standard defines complete sub-and super-scripts for numbers and common mathematical symbols (? ¹ ² ³ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ), a full superscript Latin lowercase alphabet except Q (????????????????????????????????? Ppercase Latin alphabet (?????????????), a few subscripted lowercase letters (?????????????????????? ? ? ? ? ? ? ? ? ), and some Greek letters (????????????????????????????). Note that since these characters come from different ranges, they is not being of the same size and position, depending on t He typeface.

How to set superscript in a string in C #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.