开发者

How do you add a macron to a character in an NSString? via Unicode?

开发者 https://www.devze.com 2023-02-05 23:04 出处:网络
Objective-C iOS Programming: I need to display a number like 8.33333 just as 8.3, with the three having a macron (repeating number symbol, a bar line) above it.I have done some searching and have not

Objective-C iOS Programming:

I need to display a number like 8.33333 just as 8.3, with the three having a macron (repeating number symbol, a bar line) above it. I have done some searching and have not found a solution to this. I have found the encoding for C/C++/Java source code being "\u0304" and for Unicode being "U+0304". Is there a way that I can create an NSString from a开发者_运维技巧 Unicode character? And how would a create a Unicode character with a macron?

Thanks.


For combining characters such as U+0304, the string should contain the original letter followed by the combining character. For instance,

NSString *str = @"ca\u0304t";

is a representation of cāt.

0

精彩评论

暂无评论...
验证码 换一张
取 消