I want to add spaces (” “) infront of a string (like white spaces). this is the length of the spaces
int spaces_needed=((36-[[dicBusinessDetails objectForKey:@"ResturantName"] length]))/2;
What I want is to create a string like this
NSString stringWithFormat:@" %@",[dicBusinessDetails objectForKey:@"ResturantName"];
But the spaces should NOT be fixed as above, but variable length of int spaces_needed.
Actual reason for doing this is to center align a string in a receipt
You might like
NSString‘sstringByPaddingToLength:withString:startingAtIndex