NSString in reverse Arabic to iPhone

I integrate the My App app for Arabic characters.

How to get reverse order in arabic strings?

+1
source share
1 answer

Use the following code.

All NSStrings are the same procedure for changing strings

NSString * reverse=@ "الكتب"; NSMutableString *reversedString = [NSMutableString string]; NSInteger charIndex = [reverse length]; while (charIndex > 0) { charIndex--; NSRange subStrRange = NSMakeRange(charIndex, 1); [reversedString appendString:[reverse substringWithRange:subStrRange]]; } NSLog(@"%@", reversedString); 
+2
source

Source: https://habr.com/ru/post/969526/


All Articles