O'Reilly logo

VB.NET Core Classes in a Nutshell by Ted Neward, Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required