FROM : Sherm Pendley
DATE : Tue Jul 18 22:02:02 2006
On Jul 18, 2006, at 3:43 PM, Trygve Inda wrote:
> I have an int that I want converted into a string but I want it
> prefixed
> with zeros to a fixed length. So.
>
> 1 = 00001
> 2 = 00002
>
> 534 = 00534
>
> Basically the opposite of
>
> stringByPaddingToLength:withString:startingAtIndex:
>
> Is there a method to do this directly?
NSString *foo = [NSString stringWithFormat:@"%5d", aSignedInt];
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
DATE : Tue Jul 18 22:02:02 2006
On Jul 18, 2006, at 3:43 PM, Trygve Inda wrote:
> I have an int that I want converted into a string but I want it
> prefixed
> with zeros to a fixed length. So.
>
> 1 = 00001
> 2 = 00002
>
> 534 = 00534
>
> Basically the opposite of
>
> stringByPaddingToLength:withString:startingAtIndex:
>
> Is there a method to do this directly?
NSString *foo = [NSString stringWithFormat:@"%5d", aSignedInt];
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
| Related mails | Author | Date |
|---|---|---|
| Trygve Inda | Jul 18, 21:43 | |
| Sherm Pendley | Jul 18, 22:02 | |
| Trygve Inda | Jul 18, 23:54 | |
| j o a r | Jul 19, 00:00 | |
| stephen joseph but… | Jul 19, 00:00 | |
| Trygve Inda | Jul 19, 00:02 | |
| Robert Walker | Jul 19, 00:10 | |
| Matt Neuburg | Jul 19, 02:06 | |
| Trygve Inda | Jul 19, 11:14 |






Cocoa mail archive

