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

一、HTML中:
如字符串"21st" 想要把st 设置为上标,在html标签中是21<sup>st</sup>

二、C#编辑器中
你可以使用 unicode super/subscripts,如:
var o2 = "O₂";       // or "O\x2082"   or"O\u2028"
var unit2 = "unit²"; // or "unit\xB2"  or"unit\u00B2"  or"unit\x00B2"
var m-1 = "m-1"; // m负1次方 "m\u207B\u00B9" -号就是: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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值