做C#字符串有长度限制 [英] does c# string has length limit
本文介绍了做C#字符串有长度限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
<一href="http://stackoverflow.com/questions/140468/what-is-the-maximum-possible-length-of-a-net-string">What是一个.NET字符串的最大长度?
时有限制FORC#字符串来保存数据?
Is there limit forC# string to hold data?
推荐答案
字符串不能有超过2 31 字符,因为 string.length减
是一个32位的整数。
Strings cannot have more than 231 characters, since String.Length
is a 32-bit integer.
他们也受可用内存限制。
They're also limited by available memory.
这篇关于做C#字符串有长度限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文