I am trying to get single characters from an NSString , for example "ઐતિહાસિક", "પ્રકાશન", "ક્રોધ" . I want an output like 1) ઐ, તિ, હા, સિ, ક 2) પ્ર, કા, શ, ન 3) ક્રો, ધ , but the output is as follows: 1) ઐ, ત, િ, હ, િ, ક 2) પ, ્, ર, ક, ા, શ, ન 3) ક, ્, ર, ો, ધ
I used the code as shown below:
NSMutableArray *array = [[NSMutableArray alloc]init]; for (int i=0; i<strElement.length; i++) { NSString *str = [strElement substringWithRange:NSMakeRange(i, 1)]; [array addObject:str]; } NSLog(@"%@",array);
Take strElement as "ક્રોધ", then we get the output ક , ્ , ર , ો , ધ But I need a conclusion like this ક્રો,ધ
Is there any way to get the desired result? Any method available directly in iOS, or creating it yourself, and then in any way or idea, how to create it?
Any help is appreciated