加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

C#中如何在字符串中设置上标

发布时间:2020-12-15 19:52:21 所属栏目:百科 来源:网络整理
导读:一、HTML中: 如字符串"21st" 想要把st 设置为上标,在html标签中是21supst/sup 二、C#编辑器中 你可以使用 unicode super/subscripts,如: var o2 = "O?"; // or "Ox2082"var unit2 = "unit2"; // or "unitxB2" var m-1 = "m-1"; //m负1次方 "mu207Bu00
一、HTML中:
如字符串"21st" 想要把st 设置为上标,在html标签中是21<sup>st</sup>

二、C#编辑器中
你可以使用 unicode super/subscripts,如:
var o2 = "O?";       // or "Ox2082"
var unit2 = "unit2"; // or "unitxB2"
var m-1 = "m-1"; //m负1次方 "mu207Bu00B9" -号就是:u207B 先看横坐标207,在看竖坐标B,加在一起(Unicode characters)

请参考以下网址中的表格: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 in the Latin-1 range of Unicode. The rest were placed in a dedicated section of Unicode at?U+2070 to U+209F. The two tables below show these characters. Each superscript or subscript character is 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 are reserved for future use,white cells are other characters from Latin-1.

  你也可以直接复制里面的字符在程序中修改。

Unicode characters
? 0 1 2 3 4 5 6 7 8 9 A B C D E F
U+00Bx ? ? x2 x3 ? ? ? ? ? x1 ? ? ? ? ? ?
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 are intended for semantic usage,in the following blocks:

  • The?Latin-1 Supplement?block contains the feminine and masculine?ordinal indicators?a and o.
  • The?Combining Diacritical Marks?block contains medieval superscript letter diacritics. These letters are written directly above other letters appearing in medieval Germanic manuscripts,and so these glyphs do not include spacing,for example u?. They are shown here over a long string of periods: ....?...?...?...?...?...?...?...?...?...?...?...?...?..
  • The?Combining Diacritical Marks Supplement?block contains additional medieval superscript letter diacritics,enough to complete the basic lowercase Latin alphabet except for q and y,a few small capitals and ligatures (ae,ao,av),and additional letters.
  • The?Spacing Modifier Letters?block has 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 has a few more: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.

Consolidated,the Unicode standard defines complete sub- and super-scripts for numbers and common mathematical symbols ( ? 1 2 3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ),a full superscript Latin lowercase alphabet except q ( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ),a limited uppercase Latin alphabet ( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ),a few subscripted lowercase letters ( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ),and some Greek letters ( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ). Note that since these characters come from different ranges,they may not be of the same size and position,depending on the typeface.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读