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