Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Utility/doc

From Kronopolis and the Flat Plane
Revision as of 19:53, 18 October 2025 by Wioum (talk | contribs) (Created page with "==Usage== Import: <code>local util = require('Module:Utility')</code> ==Functions== ===dump=== Turn a table into a string. <code>dump(table)</code><br> Return type: string ====Example==== <pre> local table = { dong = 'biggest', description = 'schlong' } local str = dump(table) </pre> Returns: <pre> { ["dong "] = biggest, ["description"] = schlong, } </pre> ---- ===firstToUpper=== Capitalize first character in a string. <code>firstToUpper(string)</code><br>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Utility

Usage

Import: local util = require('Module:Utility')

Functions

dump

Turn a table into a string.

dump(table)
Return type: string

Example

local table = {
    dong = 'biggest',
    description = 'schlong'
}
local str = dump(table)

Returns:

{ 
["dong "] = biggest,
["description"] = schlong,
}

firstToUpper

Capitalize first character in a string.

firstToUpper(string)
Return type: string

Example

local dong = firstToUpper("donger")

Returns:

dong = "Donger"

formatLevel

Get a formatted level based on an integer.

formatLevel(integer)
Return type: string

Example

local lv = formatLevel(0)
local lv1 = formatLevel(1)
local lv2 = formatLevel(2)

Returns:

lv = "cantrip"
lv1 = "1st"
lv2 = "2nd"