You can see that I add 40 spaces after my string but it starts at index 0.
Can I do the same thing with tab “\t” instead of spaces ” “?
NSString *firstString = [[NSString stringWithFormat:@"%@",stringToWrite] stringByPaddingToLength:40 withString:@" " startingAtIndex:0];
Yes
@"\t"will put tab instead of spaces.Also, your line could be a bit more simple :