cgossain cgossain - 6 months ago 11
Objective-C Question

how to get first three characters of an NSString?

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

Answer
 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