[iOS] objective c getting substring after and before dot

字串切割範例:

NSString *str = yourstr; 
NSArray *Array = [str componentsSeparatedByString:@"."]; 
NSString *t = [Array objectAtIndex:0]; 
NSString *t1 = [Array objectAtindex:1]; 


NSString *myString = @"app://ga/ecommerce/product:playstation4"; 
NSArray* spliteArray = [myString componentsSeparatedByString: @"/"];
NSString* lastString = [spliteArray lastObject];

 

相關文章

寫留言

你的電子郵件位址並不會被公開。 必要欄位標記為 *