How can I add certain number (between 1 and 100) of whitespaces to StringBuilder?
StringBuilder nextLine = new StringBuilder();
string time = Util.CurrentTime;
nextLine.Append(time);
nextLine.Append(/* add (100 - time.Length) whitespaces */);
What would be "ideal" solution? for
loop is ugly. I can also create array where whitespaces[i]
contains string which contains exactly i
whitespaces, but that would be pretty long hardcoded array.