I want to append a string to a NSMutableString using appendFormat, inserting white spaces to get a minimum length for my string.
In objective-c, i just used
[text.mutableString appendFormat:@"%-12s", "MyString"];
and I would get
"MyString "
But in Swift, I tried
text.mutableString.appendFormat("%-12s", "MyString")
and I get everything, but not "MyString ". It appears some random characters that I do not know where it came from.
Is there anyone who knows why that happens, and what I should do?
Thank you guys!