StringBuilder

  • Thread starter Thread starter Paddy
  • Start date Start date
P

Paddy

An code example says

StringBuilder x = new StringBuilder();

This will not compile,
please comment.

Paddy
 
any error? did you had the necessary "using" statement?
//***
using System.Text;
//***
 
Try adding
using System.Text;

to the "includes" at the top of your cs file.
 
You need to import System.Text via the 'using' statement, or use
System.Text.StringBuilder to refer to the class.

The comment is that if you do not have a 'using' statement for the namespace
a class is located in, you have to use the fully qualified name of the
class.
 
Make sure you have using System.Text; up top, or do
System.Text.StringBuilder x = new System.Text.StringBuilder()
 
Thanks all.
Paddy.

Scott C. Reynolds said:
Make sure you have using System.Text; up top, or do
System.Text.StringBuilder x = new System.Text.StringBuilder()
 

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

Back
Top