I have a string 0023525631 but what I want is the string 23525631 -- without the leading zeroes. How do I do this?
0023525631
23525631
Use Reguler Expression like this,
NSString *str =@"000034234247236000049327428900000"; NSRange range = [str rangeOfString:@"^0*" options:NSRegularExpressionSearch]; str= [str stringByReplacingCharactersInRange:range withString:@""]; NSLog(@"str %@",str);
O/P:-str 34234247236000049327428900000
str 34234247236000049327428900000
548k questions
547k answers
4 comments
86.3k users