Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Larger then String Builder ?

Status
Not open for further replies.

erxi9

Programmer
Jul 8, 2003
10
0
0
IL
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'
 
Is i think it is ( contig in a chromosom )
does exist some thing bigger ?


 
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.

A file or database is what you're looking for.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top