c# - Repeating a string using StringBuilder -
i want repeat .-
40 times , save string
using stringbuilder
why not work?
string result = new stringbuilder("").append(".-",0,40).tostring();
i know other solutions want use stringbuilder
that method not think does. 2 int parameters specify start index , length of sub-string want append.
stringbuilder
have method want: it's called insert
:
sb.insert(0, ".-", 40);
Comments
Post a Comment