How to display superscript for third power/cube characters as a string in UILabel?

后端 未结 2 1382
青春惊慌失措
青春惊慌失措 2021-02-10 13:42

I\'m trying to find solution for it and confused how do I display third power/ cube in a UILabel. I tried to find answer in previously asked question but none of them were usefu

2条回答
  •  再見小時候
    2021-02-10 14:44

    You need to include the unicode symbol for a superscripted three:

    NSInteger number = 10;
    NSString *cubedSymbol = @"\u00B3";
    NSString *tenCubed = [NSString stringWithFormat:@"%d%@",number,cubedSymbol];
    

    Plenty more fun is to be had here

提交回复
热议问题