Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a degree sign to a string?

Tags:

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.

like image 918
Sveta Avatar asked Apr 14 '11 12:04

Sveta


People also ask

How do I make a degree symbol in string?

Use the string literal: \u00B0 . For Unicode characters, it will always be "\u" followed by the character code.

How do you get a degrees symbol?

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.

How do you put a degree symbol in text in Python?

In Python, to print the degree symbol, you can use the unicode for the degree sign '\u00B0'.


1 Answers

Use the string literal: \u00B0. For Unicode characters, it will always be "\u" followed by the character code.

NSString *temperature = [NSString stringWithFormat:@"65%@", @"\u00B0"]; 
like image 151
Evan Mulawski Avatar answered Sep 17 '22 13:09

Evan Mulawski