ios - Replace "0" with blank character in String -
this question has answer here:
- nsstring removing initial zeros? 5 answers
i have nsstring
@"05205"
or @"05931"
or so. want remove leading 0 characters.
e.g. @"05205"
in @"5205"
or @"00072"
in @"72"
.
how can achieve in objective-c?
if convert string integer , string, trim leading zeros.
nsstring *s = @"0072"; nsstring *newstring =[ nsstring stringwithformat:@"%d",[s integervalue]];
Comments
Post a Comment