How to convert from string to stringbuilder?

  • Thread starter Thread starter ORC
  • Start date Start date
O

ORC

When having a string that is defined as a stringbuilder it can be converted
to a string by this:
StringbuilderText.ToString();
But what about the otherway round?

Thanks
Ole
 
lol, yes, you could also use this simple way instead of mine ;-)

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk


nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Or just StringBuilder sb = new StringBuilder(s);

Richard Blewett said:
string s = "Hello";
StringBuilder sb = new StringBuilder();
sb.Append(s);

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

When having a string that is defined as a stringbuilder it can be converted
to a string by this:
StringbuilderText.ToString();
But what about the otherway round?

Thanks
Ole



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 19/11/2004



[microsoft.public.dotnet.languages.csharp]
 
hmm, tempting to say "Read the doc..." or "take a pic"

What about:
StringBuilder myBuilder = new StringBuilder(myString);
or
myBuilder.Append(myString);
or
myBuilder.Insert(0, myString);

Maybe I did not understand the question correct???

Best regards, TEK
 
Back
Top