I'm writing in Objective-C. How can I add a degree sign to a string? I know its unicode: 00B0
and UTF8: C2 B0
.
Use the string literal: \u00B0 . For Unicode characters, it will always be "\u" followed by the character code.
Press and hold the ALT key and type 0 1 7 6 on the numeric keypad of your keyboard. Make sure the NumLock is on and type 0176 with the leading zero. If there is no numeric keypad, press and hold the Fn before typing the 0176 numbers of degree symbol.
In Python, to print the degree symbol, you can use the unicode for the degree sign '\u00B0'.
Use the string literal: \u00B0
. For Unicode characters, it will always be "\u" followed by the character code.
NSString *temperature = [NSString stringWithFormat:@"65%@", @"\u00B0"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With