util.string.title
Shared
Converts a string or codepoint to Unicode titlecase
Syntax
local result = util.string.title(
input
)Parameters
| Type | Name | Description |
|---|---|---|
string | int | input | String to convert, or a single codepoint |
Returns
| Type | Name | Description |
|---|---|---|
string | int | result | Titlecased string, or the titlecase codepoint if input was a number |
Examples
local result = util.string.title("hello")
core.engine.print("info", result) -- 'Hello'-- Most Latin letters behave the same as upper(), but some scripts differ
local result = util.string.title("dz")
core.engine.print("info", result) -- 'Dz' (titlecase form, distinct from 'DZ' uppercase)local code = util.string.title(util.string.byte("h"))
core.engine.print("info", code) -- 72 ('H')