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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -