gpt4 book ai didi

c# - C#中的字符串有多长?

转载 作者:太空宇宙 更新时间:2023-11-03 20:05:41 24 4
gpt4 key购买 nike

我对 C#WPF 架构还很陌生。我的项目中有一个 BinaryFile 类,它具有以下属性:fileNamefileLengtherrorCount数据内容。此类绑定(bind)到 Richtextbox。我需要在此类中包含一个属性,该属性将数据保存在 Richtextbox 中。使用字符串是个好主意吗?我的二进制文件非常大,平均为 10MB。

最佳答案

来自 the documentation (粗体文字由我加粗,不在源中)

A string is a sequential collection of Unicode characters that is used to represent text. A String object is a sequential collection of System.Char objects that represent a string. The value of the String object is the content of the sequential collection, and that value is immutable (that is, it is read-only). For more information about the immutability of strings, see the Immutability and the StringBuilder class section later in this topic. The maximum size of a String object in memory is 2 GB, or about 1 billion characters.

关于c# - C#中的字符串有多长?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23619530/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com