I have an Array of String, I would like to know how to fetch the first character of each string when the first character is different to previous strings.
For example:
NSArray *arr = @[@"AA", @"AAA", @"B", @"BBB", @"BBBB", @"CC", @"DD"];
I want these character in another array:
A,B,C,D
Please help me.
How to get First Character from each string of an Array
1323
18-Nov-2015
Updated on 18-Nov-2015
Tarun Kumar
18-Nov-2015For fetching and storing first character in an array use code like this:
I hope the above code is helpful for you.