How do I include superscripts in NSString?

南楼画角 提交于 2019-12-13 15:30:01

问题


Is there any way I can include a superscript with NSString? For example, I want to write square feet, like this: foot2.


回答1:


In this particular case, there is in fact a single Unicode character that represents a small "2" written above the line. It is U+00B2 (Superscript Two).

You should be able to do something like:

NSString *aString = [NSString stringWithUTF8String:"foot\u00b2"];


来源:https://stackoverflow.com/questions/9284077/how-do-i-include-superscripts-in-nsstring

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!