is there a more efficient way to generate a String full of blanks with a customizable size like the following:
private String getBlanks (int numberOfBlanks)
{
String theBlanks = "";
for (int i = 0; i < numberOfBlanks; i++)
{
theBlanks = theBlanks + " ";
}
return theBlanks;
}
Perhaps with a StringBuilder or any other type?
EDIT: Since we have Appache Commons Lang the most convinient way of doing is through the use of String Utils - leftPad, thanks everyone for the answers!
Thanks