StringBuilder

Overview

String builder is a class create strings built out of lots of small parts.

Location

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

StringBuilder()

 

init()

 

StringBuilder()

constructor (Int32)

Creates a string builder with a given capacity.

 

constructor(aCapacity: Int32)

 

StringBuilder(Int32 aCapacity)

 

init(_ aCapacity: Int32)

 

StringBuilder(Int32 aCapacity)

Parameters:

  • aCapacity:

constructor (String)

Creates a string builder with original data in it.

 

constructor(Data: String)

 

StringBuilder(String Data)

 

init(_ Data: String)

 

StringBuilder(String Data)

Parameters:

  • Data:

Append (Char): StringBuilder

Add to the end of this string builder.

 

method Append(Value: Char): StringBuilder

 

StringBuilder Append(Char Value)

 

func Append(_ Value: Char) -> StringBuilder

 

StringBuilder Append(Char Value)

Parameters:

  • Value:

Append (Char, Int32): StringBuilder

Add to the end of this string builder.

 

method Append(Value: Char; RepeatCount: Int32): StringBuilder

 

StringBuilder Append(Char Value, Int32 RepeatCount)

 

func Append(_ Value: Char, _ RepeatCount: Int32) -> StringBuilder

 

StringBuilder Append(Char Value, Int32 RepeatCount)

Parameters:

  • Value:
  • RepeatCount:

Append (Object): StringBuilder Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, Ubuntu, UIKit for Mac, watchOS Simulator, watchOS-arm64_32, watchOS-armv7k, WebAssembly, Windows

Add to the end of this string builder.

 

method Append(o: Object): StringBuilder

 

StringBuilder Append(Object o)

 

func Append(_ o: Object) -> StringBuilder

 

StringBuilder Append(Object o)

Parameters:

  • o:

Append (String): StringBuilder

Add to the end of this string builder.

 

method Append(Value: String): StringBuilder

 

StringBuilder Append(String Value)

 

func Append(_ Value: String) -> StringBuilder

 

StringBuilder Append(String Value)

Parameters:

  • Value:

Add to the end of this string builder.

 

method Append(Value: String; StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Append(String Value, Int32 StartIndex, Int32 Count)

 

func Append(_ Value: String, _ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Append(String Value, Int32 StartIndex, Int32 Count)

Parameters:

  • Value:
  • StartIndex:
  • Count:

AppendLine

Add to the end of this string builder and add a new line.

 

method AppendLine: StringBuilder

 

StringBuilder AppendLine()

 

func AppendLine() -> StringBuilder

 

StringBuilder AppendLine()

AppendLine (String): StringBuilder

Add to the end of this string builder and add a new line.

 

method AppendLine(Value: String): StringBuilder

 

StringBuilder AppendLine(String Value)

 

func AppendLine(_ Value: String) -> StringBuilder

 

StringBuilder AppendLine(String Value)

Parameters:

  • Value:

Capacity

Gets/sets the capacity of this stringbuilder.

 

property Capacity: Int32 read write;

 

Int32 Capacity { get; set; }

 

var Capacity: Int32 { get{} set{} }

 

Int32 Capacity { __get; __set; }

Chars

read/write accessor for the characters in this string.

 

property Chars[Index: Int32]: Char read write;

 

Char Chars[Int32 Index] { get; set; }

 

subscript Chars(_ Index: Int32) -> Char { get{} set{} }

 

Char Chars[Int32 Index] { __get; __set; }

Clear

Clear this stringbuilder.

 

method Clear

 

void Clear()

 

func Clear()

 

void Clear()

EnsureCapacity

ensures this string has at least aCapacity capacity.

 

method EnsureCapacity(aCapacity: Int32): Int32

 

Int32 EnsureCapacity(Int32 aCapacity)

 

func EnsureCapacity(_ aCapacity: Int32) -> Int32

 

Int32 EnsureCapacity(Int32 aCapacity)

Parameters:

  • aCapacity:

Equals (Object): Boolean  override virtual

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(sb: StringBuilder): Boolean

 

Boolean Equals(StringBuilder sb)

 

func Equals(_ sb: StringBuilder) -> Boolean

 

Boolean Equals(StringBuilder sb)

Parameters:

  • sb:

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

Insert

Insert into the string builder.

 

method Insert(Offset: Int32; Value: String): StringBuilder

 

StringBuilder Insert(Int32 Offset, String Value)

 

func Insert(_ Offset: Int32, _ Value: String) -> StringBuilder

 

StringBuilder Insert(Int32 Offset, String Value)

Parameters:

  • Offset:
  • Value:

Length

Returns the length of this string builder.

 

property Length: Int32 read write;

 

Int32 Length { get; set; }

 

var Length: Int32 { get{} set{} }

 

Int32 Length { __get; __set; }

MaxCapacity

Returns the max capacity.

 

const MaxCapacity: Int32 = 2147483647;

 

const Int32 MaxCapacity = 2147483647

 

static let MaxCapacity: Int32 = 2147483647

 

static final Int32 MaxCapacity = 2147483647

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

Remove

Remove from this stringbuilder.

 

method Remove(StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Remove(Int32 StartIndex, Int32 Count)

 

func Remove(_ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Remove(Int32 StartIndex, Int32 Count)

Parameters:

  • StartIndex:
  • Count:

Replace (Char, Char): StringBuilder

Replace characters in this stringbuilder.

 

method Replace(OldChar: Char; NewChar: Char): StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar)

 

func Replace(_ OldChar: Char, _ NewChar: Char) -> StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar)

Parameters:

  • OldChar:
  • NewChar:

Replace characters in this stringbuilder.

 

method Replace(OldChar: Char; NewChar: Char; StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar, Int32 StartIndex, Int32 Count)

 

func Replace(_ OldChar: Char, _ NewChar: Char, _ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar, Int32 StartIndex, Int32 Count)

Parameters:

  • OldChar:
  • NewChar:
  • StartIndex:
  • Count:

Replace characters in this stringbuilder.

 

method Replace(OldValue: String; NewValue: String): StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue)

 

func Replace(_ OldValue: String, _ NewValue: String) -> StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue)

Parameters:

  • OldValue:
  • NewValue:

Replace characters in this stringbuilder.

 

method Replace(OldValue: String; NewValue: String; StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue, Int32 StartIndex, Int32 Count)

 

func Replace(_ OldValue: String, _ NewValue: String, _ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue, Int32 StartIndex, Int32 Count)

Parameters:

  • OldValue:
  • NewValue:
  • StartIndex:
  • Count:

ToString  override virtual

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

ToString (Int32, Int32): String

Gets the string representation of this stringbuilder.

 

method ToString(StartIndex: Int32; Count: Int32): String

 

String ToString(Int32 StartIndex, Int32 Count)

 

func ToString(_ StartIndex: Int32, _ Count: Int32) -> String

 

String ToString(Int32 StartIndex, Int32 Count)

Parameters:

  • StartIndex:
  • Count:

 

MaxCapacity

Returns the max capacity.

 

const MaxCapacity: Int32 = 2147483647;

 

const Int32 MaxCapacity = 2147483647

 

static let MaxCapacity: Int32 = 2147483647

 

static final Int32 MaxCapacity = 2147483647

 

Capacity

Gets/sets the capacity of this stringbuilder.

 

property Capacity: Int32 read write;

 

Int32 Capacity { get; set; }

 

var Capacity: Int32 { get{} set{} }

 

Int32 Capacity { __get; __set; }

Chars

read/write accessor for the characters in this string.

 

property Chars[Index: Int32]: Char read write;

 

Char Chars[Int32 Index] { get; set; }

 

subscript Chars(_ Index: Int32) -> Char { get{} set{} }

 

Char Chars[Int32 Index] { __get; __set; }

Length

Returns the length of this string builder.

 

property Length: Int32 read write;

 

Int32 Length { get; set; }

 

var Length: Int32 { get{} set{} }

 

Int32 Length { __get; __set; }

 

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

StringBuilder()

 

init()

 

StringBuilder()

constructor (Int32)

Creates a string builder with a given capacity.

 

constructor(aCapacity: Int32)

 

StringBuilder(Int32 aCapacity)

 

init(_ aCapacity: Int32)

 

StringBuilder(Int32 aCapacity)

Parameters:

  • aCapacity:

constructor (String)

Creates a string builder with original data in it.

 

constructor(Data: String)

 

StringBuilder(String Data)

 

init(_ Data: String)

 

StringBuilder(String Data)

Parameters:

  • Data:

Append (Char): StringBuilder

Add to the end of this string builder.

 

method Append(Value: Char): StringBuilder

 

StringBuilder Append(Char Value)

 

func Append(_ Value: Char) -> StringBuilder

 

StringBuilder Append(Char Value)

Parameters:

  • Value:

Append (Char, Int32): StringBuilder

Add to the end of this string builder.

 

method Append(Value: Char; RepeatCount: Int32): StringBuilder

 

StringBuilder Append(Char Value, Int32 RepeatCount)

 

func Append(_ Value: Char, _ RepeatCount: Int32) -> StringBuilder

 

StringBuilder Append(Char Value, Int32 RepeatCount)

Parameters:

  • Value:
  • RepeatCount:

Append (Object): StringBuilder Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, Ubuntu, UIKit for Mac, watchOS Simulator, watchOS-arm64_32, watchOS-armv7k, WebAssembly, Windows

Add to the end of this string builder.

 

method Append(o: Object): StringBuilder

 

StringBuilder Append(Object o)

 

func Append(_ o: Object) -> StringBuilder

 

StringBuilder Append(Object o)

Parameters:

  • o:

Append (String): StringBuilder

Add to the end of this string builder.

 

method Append(Value: String): StringBuilder

 

StringBuilder Append(String Value)

 

func Append(_ Value: String) -> StringBuilder

 

StringBuilder Append(String Value)

Parameters:

  • Value:

Add to the end of this string builder.

 

method Append(Value: String; StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Append(String Value, Int32 StartIndex, Int32 Count)

 

func Append(_ Value: String, _ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Append(String Value, Int32 StartIndex, Int32 Count)

Parameters:

  • Value:
  • StartIndex:
  • Count:

AppendLine

Add to the end of this string builder and add a new line.

 

method AppendLine: StringBuilder

 

StringBuilder AppendLine()

 

func AppendLine() -> StringBuilder

 

StringBuilder AppendLine()

AppendLine (String): StringBuilder

Add to the end of this string builder and add a new line.

 

method AppendLine(Value: String): StringBuilder

 

StringBuilder AppendLine(String Value)

 

func AppendLine(_ Value: String) -> StringBuilder

 

StringBuilder AppendLine(String Value)

Parameters:

  • Value:

Clear

Clear this stringbuilder.

 

method Clear

 

void Clear()

 

func Clear()

 

void Clear()

EnsureCapacity

ensures this string has at least aCapacity capacity.

 

method EnsureCapacity(aCapacity: Int32): Int32

 

Int32 EnsureCapacity(Int32 aCapacity)

 

func EnsureCapacity(_ aCapacity: Int32) -> Int32

 

Int32 EnsureCapacity(Int32 aCapacity)

Parameters:

  • aCapacity:

Equals (Object): Boolean  override virtual

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(sb: StringBuilder): Boolean

 

Boolean Equals(StringBuilder sb)

 

func Equals(_ sb: StringBuilder) -> Boolean

 

Boolean Equals(StringBuilder sb)

Parameters:

  • sb:

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

Insert

Insert into the string builder.

 

method Insert(Offset: Int32; Value: String): StringBuilder

 

StringBuilder Insert(Int32 Offset, String Value)

 

func Insert(_ Offset: Int32, _ Value: String) -> StringBuilder

 

StringBuilder Insert(Int32 Offset, String Value)

Parameters:

  • Offset:
  • Value:

Remove

Remove from this stringbuilder.

 

method Remove(StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Remove(Int32 StartIndex, Int32 Count)

 

func Remove(_ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Remove(Int32 StartIndex, Int32 Count)

Parameters:

  • StartIndex:
  • Count:

Replace (Char, Char): StringBuilder

Replace characters in this stringbuilder.

 

method Replace(OldChar: Char; NewChar: Char): StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar)

 

func Replace(_ OldChar: Char, _ NewChar: Char) -> StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar)

Parameters:

  • OldChar:
  • NewChar:

Replace characters in this stringbuilder.

 

method Replace(OldChar: Char; NewChar: Char; StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar, Int32 StartIndex, Int32 Count)

 

func Replace(_ OldChar: Char, _ NewChar: Char, _ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Replace(Char OldChar, Char NewChar, Int32 StartIndex, Int32 Count)

Parameters:

  • OldChar:
  • NewChar:
  • StartIndex:
  • Count:

Replace characters in this stringbuilder.

 

method Replace(OldValue: String; NewValue: String): StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue)

 

func Replace(_ OldValue: String, _ NewValue: String) -> StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue)

Parameters:

  • OldValue:
  • NewValue:

Replace characters in this stringbuilder.

 

method Replace(OldValue: String; NewValue: String; StartIndex: Int32; Count: Int32): StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue, Int32 StartIndex, Int32 Count)

 

func Replace(_ OldValue: String, _ NewValue: String, _ StartIndex: Int32, _ Count: Int32) -> StringBuilder

 

StringBuilder Replace(String OldValue, String NewValue, Int32 StartIndex, Int32 Count)

Parameters:

  • OldValue:
  • NewValue:
  • StartIndex:
  • Count:

ToString  override virtual

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

ToString (Int32, Int32): String

Gets the string representation of this stringbuilder.

 

method ToString(StartIndex: Int32; Count: Int32): String

 

String ToString(Int32 StartIndex, Int32 Count)

 

func ToString(_ StartIndex: Int32, _ Count: Int32) -> String

 

String ToString(Int32 StartIndex, Int32 Count)

Parameters:

  • StartIndex:
  • Count: