If I have a string like this:
var myString = "abc";
or
var myString = "a";
Is there a way that I can pad the string with spaces so it's always has a length of ten?
If I have a string like this:
var myString = "abc";
or
var myString = "a";
Is there a way that I can pad the string with spaces so it's always has a length of ten?
Try something like this:
while(myString.length < 10) {
myString += " ";
}