Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSString* source = @"11001200"; //test length = 6
- NSString* hh1 = [source substringWithRange:NSMakeRange(0, 2)];
- NSString* mm1 = [source substringWithRange:NSMakeRange(2, 2)];
- NSString* hh2 = [source substringWithRange:NSMakeRange(4, 2)];
- NSString* mm2 = [source substringWithRange:NSMakeRange(6, 2)];
- NSString* results =[NSString stringWithFormat:@"%@:%@-%@:%@",hh1,mm1,hh2,mm2];
Add Comment
Please, Sign In to add comment