Name

StringBuilder

Synopsis

This String helper class enables in-place modification of a string without having to create new string instances. Since strings are immutable, their values cannot change once set. (Attempts to assign a new value to an existing string succeed, but at the expense of destroying and re-creating the original string.) The StringBuilder constructor allows you to set the size of the StringBuilder and specify the initial string it contains. The Insert() methods put new data (of varying types) into the StringBuilder at a specified position. Append() adds data to the end of a StringBuilder. The ToString() method converts the StringBuilder into a real string.

Public NotInheritable Class StringBuilder
                  ' Public Constructors
   Public Sub New() 
   Public Sub New( ByVal capacity As Integer) 
   Public Sub New(ByVal capacity As Integer, 
        ByVal maxCapacity As Integer) 
   Public Sub New( ByVal value As String) 
   Public Sub New(ByVal value As String, 
        ByVal capacity As Integer) 
   Public Sub New(ByVal value As String, 
        ByVal startIndex As Integer, 
        ByVal length As Integer, ByVal capacity As Integer) 
' Public Instance Properties
   Public Property Capacity As Integer  
   Public Default Property Chars(
        ByVal index As Integer) As Char  
   Public Property Length As Integer  
   Public ReadOnly Property MaxCapacity As Integer  
' Public Instance Methods
   Public Function Append(
        ByVal value As Boolean) As StringBuilder  
   Public Function Append(
        ByVal value As Byte) As StringBuilder  
   Public Function Append( ByVal value As ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.