ios - Replace "0" with blank character in String -


this question has answer here:

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

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -