1,029
edits
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==StringBuilder Module Documentation == | == StringBuilder Module Documentation == | ||
The | The `StringBuilder` module provides functionality to efficiently build and manipulate strings in Lua. | ||
=== Constructor === | === Constructor === | ||
====StringBuilder.new()==== | |||
Creates a new | Creates a new `StringBuilder` object. | ||
* '''Returns:''' | * '''Returns:''' `StringBuilder` object. | ||
=== Methods === | === Methods === | ||
====StringBuilder:append(...)==== | |||
Appends strings or values to the | Appends strings or values to the `StringBuilder` buffer. | ||
* '''Parameters:''' | * '''Parameters:''' | ||
* | * `...`: One or more values to append to the buffer. | ||
====StringBuilder:appendLine(...)==== | |||
Appends strings or values followed by a newline ( | Appends strings or values followed by a newline (`\n`) to the `StringBuilder` buffer. | ||
* '''Parameters:''' | * '''Parameters:''' | ||
* | * `...`: One or more values to append to the buffer. | ||
====StringBuilder:clear()==== | |||
Clears the contents of the | Clears the contents of the `StringBuilder` buffer. | ||
* '''Usage:''' Call this method to reset the | * '''Usage:''' Call this method to reset the `StringBuilder` buffer to an empty state. | ||
====StringBuilder:toString()==== | |||
Converts the | Converts the `StringBuilder` buffer into a concatenated string. | ||
* '''Returns:''' Concatenated string representation of the | * '''Returns:''' Concatenated string representation of the `StringBuilder` buffer. | ||
=== Example Usage === | === Example Usage === | ||
To use the | To use the `StringBuilder` module in your Lua scripts, follow these examples: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
edits