-
-
Save brunokoga/862515d70c023be67761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)test | |
{ | |
NSMutableString *koga = [NSMutableString stringWithString:@"Salve o Corinthians o campeao dos campeoes!"]; | |
NSArray *normalLetters = [self normalLetters]; | |
NSArray *bubbleLetters = [self bubbleLetters]; | |
for (int i = 0; i < [normalLetters count]; i++) | |
{ | |
[koga replaceOccurrencesOfString:normalLetters[i] | |
withString:bubbleLetters[i] | |
options:0 | |
range:NSMakeRange(0, [koga length])]; | |
} | |
NSLog(@"%@", koga); | |
} | |
- (NSArray *)normalLetters | |
{ | |
NSString *normalLettersString = @"a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9"; | |
NSArray *normalLetters = [normalLettersString componentsSeparatedByString:@" "]; | |
return normalLetters; | |
} | |
- (NSArray *)bubbleLetters | |
{ | |
NSString *bubbleLettersString = @"ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨"; | |
NSArray *bubbleLetters = [bubbleLettersString componentsSeparatedByString:@" "]; | |
return bubbleLetters; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment