-
-
Notifications
You must be signed in to change notification settings - Fork 2
Library: String
Aviril edited this page Nov 29, 2024
·
13 revisions
Lua provides built in string
module by default, however its deprived of utf8
support. utf8 is essential especially when trying to work w/ non ASCII characters such as 'cyrillic' etc. This module extends existing string
module while adding utf8
support without breaking backwards compatibility!
It gets imported automatically by default whenever you initialize assetify
.
--Declare it globally only once
loadstring(exports.assetify_library:import())()
Our extensions are written with backwards compatibility in mind; Expect your previous code to work as usual! However we recommend upgrading to newer syntax.
local bool: result = string.isVoid(
string: baseString
)
local ~: result = string.parse(
string: baseString
)
local float: r, float: g, float: b = string.parseHex(
string: baseString
)
local string: result = string.formatTime(
number: milliseconds
)
ℹ️ For
type
andoptions
refer
local string: result = string.encode(
string: baseString,
string: type,
table: options
)
ℹ️ For
type
andoptions
refer
local string: result = string.decode(
string: baseString,
string: type,
table: options
)
local table: result = string.split(
string: baseString
string: separator
)
local string: result = string.kern(
string: baseString
string: kerner --(Optional) By default it use " " as kerner if left unspecified
)
local string: result = string.detab(
string: baseString
)
local string: result = string.minify(
string: baseString
)