String processing improvement

  • Thread starter Thread starter Kimelia
  • Start date Start date
K

Kimelia

I have a string variable, let say:

string s;

and I need to assign several lines to this string variable, so:

s += "rept ioruet uroeiut oirueoi uorieuto iruetoi reoituroeuti roeutoi
ureoitur oieutoire";
s += "uytuy tuytjghjlkg fhjlkghlkjhm fhm mhm gfmh mgfh rtiy triypotiry";
s += "iuygoiem,dsfdshfkewyoturen fgjfdhg kdfhgl hgjk hfdjhgk.fdagjhd agkhfd
ghd fa";
s += "reptioru eturoei utoirueoitu orieutoirue toireo uroeutir oeutoiu
reoituroie utoire";
s += "re ptiorue turoeiu toirue oituor ieutoi ruetoi reoituro eutiro eutoi
ureo ituroieu toire";

I think there might be a way to improve above processing, can anybody
provide me some suggestions?

Thanks
(Sorry, I am a newbie in C#)
 
If you need to compose large strings then, from a performance perspective,
you may consider using a StringBuilder instead of a String.
 
Back
Top