Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
NSString* strName = [NSString stringWithFormat:@"img_00%d.jpg", pp];
and works fine, but if pp took the value of 10 for example I wish have img_010.jpg as result, and not img_0010.jpg... how can I format the string??
thanks
Use the format string "img_%03d.jpg" to get decimal numbers with three digits and leading zeros.
Use the format string "img_%03d.jpg" to get decimal numbers with three digits and leading zeros.
ReplyDelete