Si es el objetivo de la búsqueda determinar si una subcadena determinada existe (es decir, si no está interesado en la posición de la subcadena), puede buscar cadenas antes de almacenarlos en el StringBuilder objeto.
If the goal of the search is to determine whether a particular substring exists (that is, if you aren't interested in the position of the substring), you can search strings before storing them in the StringBuilder object.
Alte rezultate
La nueva capacidad no debe ser mayor que el StringBuilder máximo del objeto.
En el ejemplo siguiente se usa el Append, AppendLine, AppendFormat, y Insert métodos para expandir el texto de un StringBuilder objeto.
The following example uses the Append, AppendLine, AppendFormat, and Insert methods to expand the text of a StringBuilder object.
Si adopta este enfoque, debe trabajar desde el final de la StringBuilder objeto en sus comienzos, por lo que no tiene que convertir repetidamente la StringBuilder objeto en una cadena.
If you adopt this approach, you should work from the end of the StringBuilder object to its beginning so that you don't have to repeatedly convert the StringBuilder object to a string.
La StringBuilder clase incluye los siguientes métodos para expandir el contenido de una StringBuilder objeto
The StringBuilder class includes the following methods for expanding the contents of a StringBuilder object
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.
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.
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