General Information
LibString adds new functions to Lua's string
table for common tasks found in most string libraries.
New string functions
string.concat
concatenates a list of strings.string.formatn
enhances the defaultstring.format
with index-specifiers like"%1s %10i"
for accessing arguments out-of-order. This is especially useful for localization.string.insert
inserts a string into another at a specified index.string.join
concatenates a list of strings by inserting a separator string between each.string.prefix
checks whether a string is a prefix of another (i.e. starts with).string.split
splits a string at given delimeters and returns the respective substrings either as list or table.string.gsplit
does the same asstring.split
but can be used infor
loops like Lua'sstring.gmatch
.string.suffix
checks whether a string is a suffix of another (i.e. ends with).string.tostring
accepts a list of arguments and returns a list of strings (Lua'stostring
accepts only one argument).string.ltrim
,string.rtrim
andstring.trim
remove characters at the beginning, end or both ends of a string, respectively.
Detailed function descriptions can be found on the documentation page.