NSString: 为上标寻找 Unicode: 1, 2, 3 [英] NSString: Looking for Unicode for superscript: 1, 2, 3

查看:81
本文介绍了NSString: 为上标寻找 Unicode: 1, 2, 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找可以为 1、2、3 设置上标的 Unicode 或某种方法或字节语言.无论出于何种原因,Unicode 都有 0、4、5、6、7、8、9 的上标,但没有1、2、3.

I am looking for the Unicode or some method or byte language that can put out superscripts for 1, 2, 3. For whatever reason Unicode has superscripts for 0, 4, 5, 6, 7, 8, 9, but not 1, 2, 3.

你能在 NSString 中做像 HTML 一样的上标吗?

Can you do superscripts like HTML in NSString?

推荐答案

来自字符调色板:

¹
SUPERSCRIPT ONE
Unicode: U+00B9, UTF-8: C2 B9

²
SUPERSCRIPT TWO
Unicode: U+00B2, UTF-8: C2 B2

³
SUPERSCRIPT THREE
Unicode: U+00B3, UTF-8: C2 B3

为了使它们成为 NSStrings,你需要:

This, to make them in to NSStrings, you'd do:

NSString *superscript1 = @"\u00B9";
NSString *superscript2 = @"\u00B2";
NSString *superscript3 = @"\u00B3";

这篇关于NSString: 为上标寻找 Unicode: 1, 2, 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆