LibString

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 default string.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 as string.split but can be used in for loops like Lua's string.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's tostring accepts only one argument).
  • string.ltrim, string.rtrim and string.trim remove characters at the beginning, end or both ends of a string, respectively.

Detailed function descriptions can be found on the documentation page.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    37226
  • Created
    Mar 5, 2012
  • Last Released File
    Jul 22, 2013
  • Total Downloads
    2,618
  • License

Categories

Members

Recent Files