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.
Cuando haya terminado de modificar el valor de un StringBuilder objeto, puede llamar a su StringBuilder.ToString método para convertir en una cadena.
When you have finished modifying the value of a StringBuilder object, you can call its StringBuilder.ToString method to convert it to a string.
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
Puede definir explícitamente la capacidad máxima de un StringBuilder objeto mediante una llamada a la StringBuilder(Int32, Int32) constructor.
You can explicitly define the maximum capacity of a StringBuilder object by calling the StringBuilder(Int32, Int32) constructor.
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