473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

c# string size limit? length of string limit?

c# string size limit? length of string limit?
Apr 19 '06 #1
2 22249
Just give it a try. Likely Integer.MaxValue at best. That is not a practical
limit but rather therorical limit (IMO yuou 'll have an out of memory error
before)
--

"Daniel" <so*******************@yahoo.com> a écrit dans le message de news:
eh**************@TK2MSFTNGP03.phx.gbl...
c# string size limit? length of string limit?

Apr 19 '06 #2

"Patrice" <sc****@chez.com> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Just give it a try. Likely Integer.MaxValue at best. That is not a
practical limit but rather therorical limit (IMO yuou 'll have an out of
memory error before)


Well, its not quite that simple. int.MaxValue is the most the string class
itself could handle, you are right, but since characters take up two bytes,
that many characters would go way beyond the max possible allocation. The
best theoretical high value is 2^31(or 2147483648) characters, since that is
exactly how many would fit in memory. Practially it'd be much, much smaller.

The bigger question is what is wrong with your design if you are dealing
with strings that are gigabytes in length.
Apr 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: John Smith | last post by:
Hi, I'm writing a library in C++ which is supposed to be used by people using C. One function I have must return a string to users which is arbitrary length. The user must be able to use this...
1
by: Paul | last post by:
Hi just wondering how to limit the string size for a data grid column, can this be done from the properties box, data formatting expression? If so what would be the expression to limit it to 20...
5
by: Daniel | last post by:
c# string size limit? length of string limit?
7
by: pattreeya | last post by:
Hello, how can I get the number of byte of the string in python? with "len(string)", it doesn't work to get the size of the string in bytes if I have the unicode string but just the length. (it...
10
by: lovecreatesbea... | last post by:
Is it correct and safe to compare a string object with "", a pair of quotation marks quoted empty string?If the string object: s = ""; does s contain a single '\'? Is it better to use...
1
by: Rick Knospler | last post by:
I am trying to convert a vb6 project to vb.net. The conversion worked for the most part except for the fixed length strings and fixed length string arrays. Bascially the vb6 programmer stored all...
9
by: Jeremy Kitchen | last post by:
Are there any library functions that can help me to do this? If necessary I can convert the string to a byte array. I don't want to have to write my own Hex conversion if it isn't necessary. ...
11
by: Christopher Pisz | last post by:
Is std::string::npos always going to be less than any std::string 's size()? I am trying to handle a replacement of all occurances of a substr, in which the replacement also contains the substr....
3
by: vctiger | last post by:
could someone tell me how to calculate the size of a string constant?Thanks. The following is my source code which contain few bugs in it. #include <iostream> #include <string> using namespace...
7
by: copx | last post by:
Do the standards say anything about size limits for string literals (min size, max size)? I want to know this to make sure that my code is portable. The program in question is ANSI C89, but I would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.