Helper class for building (possibly large) string values.
sealed class
|
StringBuilder
|
implements
|
IBuilder<string>
|
||
IInternalBuffer<char[]>
|
Returns the internal data buffer of this object.
public
property
|
InternalBuffer
{
get
}
|
||
type
|
char[]
|
||
value
|
|
The internal buffer. | |
implements
|
IInternalBuffer.InternalBuffer
|
Remarks:
In most cases, client code will never use the internal buffer of an object. However, under some circumstances it can be advantageous to access the internal buffer directly (e.g. in order to avoid copy operations, reduce amount of produced garbage). Messing with the internal buffer of an object will result in undefined behaviour. So anyone using the internal buffer must know exactly what he or she is doing.
Returns the current string length.
public
property
|
Length
{
get
}
|
||
type
|
int32
|
||
value
|
|
The current string length. |
Creates a new instance of StringBuilder.
public
constructor
|
StringBuilder
(int32 initialCapacity = 32)
|
||
params
|
initialCapacity
|
[>=0]
|
The
initial
character
buffer
capacity.
Defaults
to
32 .
|
Appends the given characters.
public
method
|
Append
(char[] characters)
|
||
type
|
StringBuilder
|
||
params
|
characters
|
[not-null]
|
The character array. |
returns
|
|
this |
Appends the given string.
public
method
|
Append
(string str)
|
||
type
|
StringBuilder
|
||
params
|
str
|
The string to append. | |
returns
|
|
this |
Appends the given string.
public
method
|
Append
(StringBuilder builder)
|
||
type
|
StringBuilder
|
||
params
|
builder
|
[not-null]
|
The string to append. |
returns
|
|
this |
Appends the string representation of the given boolean value.
public
method
|
Append
(bool value)
|
||
type
|
StringBuilder
|
||
params
|
value
|
The object value. | |
returns
|
|
this |
Appends the string representation of the given object value.
public
method
|
Append
(object value)
|
||
type
|
StringBuilder
|
||
params
|
value
|
The object value. | |
returns
|
|
this |
Appends the given character count times.
public
method
|
Append
(char character,
int32 count = 1)
|
||
type
|
StringBuilder
|
||
params
|
character
|
The character to append. | |
count
|
[>=0]
|
Number
of
times
to
append
character.
Defaults
to
1 .
|
|
returns
|
|
this |
Appends the string representation of the given integer number.
public
method
|
Append
(int64 number,
FormatFlags flags = FormatFlags.Default)
|
||
type
|
StringBuilder
|
||
params
|
number
|
The integer number. | |
flags
|
The number format flags to use. | ||
returns
|
|
this |
Appends the string representation of the given decimal number.
public
method
|
Append
(float64 number,
FormatFlags flags = FormatFlags.Default)
|
||
type
|
StringBuilder
|
||
params
|
number
|
The decimal number. | |
flags
|
The number format flags to use. | ||
returns
|
|
this |
Appends the given characters.
public
method
|
Append
([]
char[] characters,
int32 offset,
int32 count)
|
||
type
|
StringBuilder
|
||
params
|
characters
|
[not-null]
|
The character array. |
offset
|
[>=0]
|
Index of first character in characters to append. | |
count
|
[>=0]
|
Total number of characters to append. | |
returns
|
|
this |
Appends the given string.
public
method
|
Append
(string str,
int32 offset,
int32 count)
|
||
type
|
StringBuilder
|
||
params
|
str
|
The string to append. | |
offset
|
[>=0]
|
Index of first character in str to append. | |
count
|
[>=0]
|
Total number of characters to append. | |
returns
|
|
this |
Finishes the build process and returns the resulting object.
[OwnerReturn, OwnerThis]
|
||||
public
method
|
Build
()
|
|||
type
|
string
|
|||
returns
|
The resulting object. | |||
implements
|
IBuilder.Build
|
Clears the content of this StringBuilder.
public
method
|
Clear
()
|
||
type
|
StringBuilder
|
||
returns
|
|
this |
public
method
|
Newline
(int32 n = 1)
|
||
type
|
StringBuilder
|
||
params
|
n
|
public
method
|
Pattern
(string pattern)
|
||
type
|
Format_StringBuilder
|
||
params
|
pattern
|
Removes a portion of the current string data.
public
method
|
Remove
(int32 offset,
int32 length)
|
||
params
|
offset
|
[0..Length]
|
Offset to first character to remove. |
length
|
[0..Length-offset]
|
Number of characters to remove. |
[Pure]
|
||||
public
override
method
|
ToString
()
|
|||
type
|
string
|