Skip to content

StringBuilder

Inherits: Class

Methods

Commit

lua
function StringBuilder:Commit()
  -> string

Commits the string builder and returns the generated string.

Returns:

TypeDescription
string

GetParamCount

lua
function StringBuilder:GetParamCount(name)
  -> number

Gets the number of occurrences of a parameter in the template.

Parameters:

NameTypeDescription
namestringThe parameter name

Returns:

TypeDescription
number

SetParam

lua
function StringBuilder:SetParam(name, value)
  -> self

Sets the value of a named parameter.

Parameters:

NameTypeDescription
namestringThe parameter name
valueanyThe parameter value

Returns:

TypeDescription
self

SetTemplate

lua
function StringBuilder:SetTemplate(template)
  -> self

Sets the template.

Parameters:

NameTypeDescription
templatestringThe template string to format

Returns:

TypeDescription
self

Functions

Create

lua
function StringBuilder.Create()
  -> StringBuilder

Creates a new string builder object.

Returns:

TypeDescription
StringBuilder