C#中字符串的大小是多少. [英] What is the size of a string in C#.

查看:112
本文介绍了C#中字符串的大小是多少.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#中的字符串大小是否有任何限制.请让我知道.
提前谢谢.

Is there any limitation for the size of a string in C #. Please let me know on this.
Thanks In advance.

推荐答案

哦,拜托.如果字符串的长度返回int,您是否不认为这将是32位int的最大大小?

2147483647字节
Oh come on. If the length of the string is returned an int, don''t you think it would be the maximum size of a 32-bit int?

2147483647 bytes


4 GB将是字符串变量的最大大小.
到现在为止,只有少数人发现它远不止于此.因此,我必须逐个字符地尝试自己以确定确切的大小.

http://www.pcreview.co.uk/forums/thread-2539908.php [ ^ ]

:thumbsup:
4 GB would be the maximum size of a string variable.
Until now, a few people found it lot less than that. So I have to try myself character by character to determine the exact size.

http://www.pcreview.co.uk/forums/thread-2539908.php[^]

:thumbsup:


到底是什么让某人问这个问题,而不是编写代码来找出答案?
What on earth would possess someone to ask this, instead of writing code to find out ?


这篇关于C#中字符串的大小是多少.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆