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

many to many - Django Rest Framework ManyToMany filter multiple values -

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

Java Entity Manager - JSON reader was expecting a value but found 'db' -