Users Pricing

forum

home / developersection / forums / how to get first character from each string of an array

How to get First Character from each string of an Array

zack mathews 1625 18 Nov 2015
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.

zack mathews

Other


1 Answers

Tarun Kumar 18 Nov 2015 Accepted Answer