type string

  • Thread starter Thread starter Marco Ivaldi
  • Start date Start date
M

Marco Ivaldi

Hi,
I need load in a string about 500 characters.
String type has a capacity of 256.
What type i can use?
Thanks!
 
Marco Ivaldi said:
I need load in a string about 500 characters.
String type has a capacity of 256.
What type i can use?

Where did you read 256? A string in C# can hold a lot more than that!

P.
 
Marco Ivaldi said:
I need load in a string about 500 characters.
String type has a capacity of 256.
What type i can use?

No, the string type most definitely *doesn't* have a capacity of only
256 characters. What makes you think it does?
 
Hi,
I need load in a string about 500 characters.
String type has a capacity of 256.
What type i can use?
Thanks!

You can use String
it can easily store more than 500 characters
There is no set capacity for it except the memory on your machine

I don't know where you got the 256 limit from but it's not true

Vin
 
Strings can be much bigger. If you cannot load at once, consider chunking it
in. As an example:

StringBuilder sb = new StringBuilder();
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
sb.Append("12345678901234567890");
....
string newString = sb.ToString();
Response.Write(newString);

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
Back
Top