TextBuilder Data Type

Represents a lighweight wrapper for the .Net implementation of StringBuilder.

The following methods are available on instances of the TextBuilder data type.

Method name Description
Append(Text) Appends a copy of the specified string to this TextBuilder instance.
AppendLine([Text]) Appends a copy of the specified string followed by the default line terminator to the end of the current TextBuilder object. If this parameter is omitted, only the line terminator will be appended.
Capacity([Integer]) Gets or sets the maximum number of characters that can be contained in the memory allocated by the current instance.
Clear() Removes all characters from the current TextBuilder instance.
EnsureCapacity(Integer) Ensures that the capacity of this TextBuilder instance is at least the specified value.
Insert(Integer, Text) Inserts a string into this TextBuilder instance at the specified character position.
Length([Integer]) Gets or sets the length of this TextBuilder instance.
MaxCapacity() Gets the maximum capacity of this TextBuilder instance.
Remove(Integer, Integer) Removes the specified range of characters from this TextBuilder instance.
Replace(Text, Text) Replaces all occurrences of a specified string in this TextBuilder instance with another specified string.
Replace(Text, Text, Integer, Integer) Replaces, within a substring of this instance, all occurrences of a specified string in this TextBuilder instance with another specified string.
ToText() Converts the value of this TextBuilder instance to a Text.
ToText(Integer, Integer) Converts the value of a substring of this TextBuilder instance to a Text.

Note

For performance reasons all HTTP, JSON, TextBuilder, and XML types are reference types, not value types. Reference types holds a pointer to the data elsewhere in memory, whereas value types store its own data.

See Also

Getting Started with AL
Developing Extensions