字串切割範例:
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];