En.net Core y en el.NET Framework 4,0 y versiones posteriores, cuando se crea una instancia StringBuilder del objeto llamando al StringBuilder(Int32, Int32) constructor, la longitud y la capacidad de la StringBuilder instancia pueden crecer más allá del valor de su MaxCapacity propiedad.Ejemplos
In.NET Core and in the.NET Framework 4.0 and later versions, when you instantiate the StringBuilder object by calling the StringBuilder(Int32, Int32) constructor, both the length and the capacity of the StringBuilder instance can grow beyond the value of its MaxCapacity property.
Alte rezultate
La nueva capacidad no debe ser mayor que el StringBuilder máximo del objeto.
Un objeto StringBuilder mantiene un búfer para acomodar la concatenación de nuevos datos.
A StringBuilder object maintains a buffer to accommodate the concatenation of new data.
Buscar valores de cadena antes de agregarlos a la StringBuilder objeto.
Search string values before adding them to the StringBuilder object.
En el ejemplo siguiente se utiliza tres de estas sobrecargas del constructor para crear instancias de StringBuilder objetos.
The following example uses three of these constructor overloads to instantiate StringBuilder objects.
Almacena cuatro instancias de cada letra del alfabeto inglés en un StringBuilder objeto.
It stores four occurrences of each letter of the English alphabet in a StringBuilder object.
Anexa diez números aleatorios a una StringBuilder de objetos y, a continuación, recorre en iteración cada carácter.
It appends ten random numbers to a StringBuilder object, and then iterates each character.
Si el tamaño final de la StringBuilder objeto es probable que crezca extremadamente grande, normalmente más de varios megabytes.
If the eventual size of the StringBuilder object is likely to grow exceedingly large, typically in excess of several megabytes.
Crear instancias de un StringBuilder objeto llamando a uno de sus seis constructores de clase sobrecargada que se enumeran en la tabla siguiente.
You instantiate a StringBuilder object by calling one of its six overloaded class constructors, which are listed in the following table.
Puede definir explícitamente la capacidad inicial de un StringBuilder objeto de las maneras siguientes
You can explicitly define the initial capacity of a StringBuilder object in the following ways
Para obtener más información, consulte el Buscar el texto en un objeto StringBuilder sección.
For more information, see the Searching the text in a StringBuilder object section.
Puede tener acceso a los caracteres de un StringBuilder objeto usando el StringBuilder.Chars propiedad.
You can access the characters in a StringBuilder object by using the StringBuilder.Chars property.
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.
Înregistrează-te pentru a accesa mai multe exemple