I would like to be able to right align a string using spaces. I have to be able to use the stringWithFormat: method.
So far I have tried the recommended format and it does not seem to work: [NSString stringWithFormat:@"%10@",@"test"].
I would expect this to return a string that has six spaces followed by “test” but all I am getting is “test” with no spaces.
It appears that
stringWithFormatignores the sizing requests of the%@format specifier. However,%sspecifier works correctly:This prints
' test'.