Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get position of character in NSString?

Tags:

ios

I have this NSString

Asia/Tokyo

I want to get only "Tokyo" by removing "Asia/" I know it will get to work by searching for the position of "/" but how do i do that? pls help

like image 382
user3517855 Avatar asked Apr 17 '14 16:04

user3517855


1 Answers

To get the location of a substring in a string :

[@"Asia/Tokyo" rangeOfString:@"/"].location
like image 99
delannoyk Avatar answered Oct 18 '22 14:10

delannoyk