【问题标题】:How to put a non-breaking space in an NSString?如何在 NSString 中放置一个不间断的空格?
【发布时间】:2013-09-23 12:05:35
【问题描述】:

我想定义一个长度为 1 的NSString,其唯一字符是不间断空格。我该怎么办?

【问题讨论】:

    标签: cocoa-touch cocoa nsstring


    【解决方案1】:

    使用通用字符名称

    // http://en.wikipedia.org/wiki/Non-breaking_space
    NSString* const nonBreakingSpace = @"\u00A0";
    
    // small-u takes four digits, big-u takes eight
    // NSString* const nonBreakingSpace = @"\U000000A0";
    

    【讨论】:

    • 这里只是一点点说明:如果你通过本地化发送这个,对我来说只有大写 U 有效,但有 4 位数字。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-03
    • 1970-01-01
    • 1970-01-01
    • 2016-06-13
    • 2018-01-09
    相关资源
    最近更新 更多