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
Ask by zack mathews
Updated 18 Nov 2015
For fetching and storing first character in an array use code like this:
I hope the above code is helpful for you.