Hello !
i am dealing with large sequences and im usuelly use
string builder but i need am object that can hold larger
sequence can you please help me ? ?
does anyone know the capacity of the object string builder ?
The maximum length you can store in a stringbuilder is (according to msdn) 2,147,483,647 characters - which acullay is a lot. Is your string really longer than that?
You could use more than one stringbuilder if your string is longer than that.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
Since few pc's has that much memory anyway, you might as well use a file. You could use a stringbuilder to cache some of the string and them dump it to a file when its full.
If you really got that much memory, the only thing I can think of is to make an array of strings (or char arrays), which is a way of allocating more than ~2 Gb of memory. That will cause an out of memory exception on pcs with less memory.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
Don't forget that .NET uses UTF-16 Unicode internally -- which uses 2 bytes per character, so to hold a string of length 2,147,483,647 you would need 4,294,967,294 bytes of memory (4gb!) plus memory for the OS, the .NET runtime, video driver, etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.