cgossain cgossain - 1 year ago 87
Objective-C Question

how to get first three characters of an NSString?

How can I return the first three characters of an NSString?

Answer Source
 mystr=[mystr substringToIndex:3];

Be sure your string has atleast 3 ch.. o.e. it will crash the app.

Here are some other links to check NSsting operations...

Link1

Link2

Apple Link