C# Class Jurassic.ConcatenatedString

Represents a string that supports efficient concatenation. This class is used instead of System.String when two strings are concatenated together using the addition operator (+) or the concat() function. Use of this class avoids the creation of useless intermediary strings and by doing so speeds up string concatenation dramatically (this change improved sunspider/string-validate-input.js by almost 20x).
Show file Open project: paulbartrum/jurassic Class Usage Examples

Public Methods

Method Description
Append ( ConcatenatedString str ) : void

Appends the given string to the end of this object.

Append ( object obj ) : void

Appends the given object (converted to a string) to the end of this object.

Append ( string str ) : void

Appends the given string to the end of this object.

Concatenate ( ConcatenatedString str ) : ConcatenatedString

Returns a new ConcatenatedString instance containing the concatenation of this ConcatenatedString and the given string.

Concatenate ( object obj ) : ConcatenatedString

Returns a new ConcatenatedString instance containing the concatenation of this ConcatenatedString and the given object (converted to a string).

Concatenate ( string str ) : ConcatenatedString

Returns a new ConcatenatedString instance containing the concatenation of this ConcatenatedString and the given string.

ConcatenatedString ( string initialValue ) : System

Creates a new ConcatenatedString instance from the given string.

ConcatenatedString ( string left, string right ) : System

Creates a new ConcatenatedString instance by concatenating the given strings.

ToString ( ) : string

Returns a string representing the current object.

Private Methods

Method Description
ConcatenatedString ( StringBuilder builder ) : System

Method Details

Append() public method

Appends the given string to the end of this object.
public Append ( ConcatenatedString str ) : void
str ConcatenatedString The string to append.
return void

Append() public method

Appends the given object (converted to a string) to the end of this object.
public Append ( object obj ) : void
obj object The object to append.
return void

Append() public method

Appends the given string to the end of this object.
public Append ( string str ) : void
str string The string to append.
return void

Concatenate() public method

Returns a new ConcatenatedString instance containing the concatenation of this ConcatenatedString and the given string.
public Concatenate ( ConcatenatedString str ) : ConcatenatedString
str ConcatenatedString The string to append.
return ConcatenatedString

Concatenate() public method

Returns a new ConcatenatedString instance containing the concatenation of this ConcatenatedString and the given object (converted to a string).
public Concatenate ( object obj ) : ConcatenatedString
obj object The object to append to this string.
return ConcatenatedString

Concatenate() public method

Returns a new ConcatenatedString instance containing the concatenation of this ConcatenatedString and the given string.
public Concatenate ( string str ) : ConcatenatedString
str string The string to append.
return ConcatenatedString

ConcatenatedString() public method

Creates a new ConcatenatedString instance from the given string.
public ConcatenatedString ( string initialValue ) : System
initialValue string The initial contents of the concatenated string.
return System

ConcatenatedString() public method

Creates a new ConcatenatedString instance by concatenating the given strings.
public ConcatenatedString ( string left, string right ) : System
left string The left-most string to concatenate.
right string The right-most string to concatenate.
return System

ToString() public method

Returns a string representing the current object.
public ToString ( ) : string
return string