How to convert from string to stringbuilder?

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
 
R

Richard Blewett [DevelopMentor]

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]
 
T

TEK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top