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

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -