mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 07:45:28 +00:00

The built-in string module is set as the metatable index for the stringx module, and the stringx module is set as the metatable index for strings, meaning all string and stringx methods are available through (''):method_name. This also enables direct indexing of strings to get individual characters (ie ('str')[1] and the like), which package.lua already assumed even though it didn't work. Negative indices are supported to, and index from the end of the srring. New functions: - stringx.split - stringx.parenthetical_split - stringx.map_split - stringx.escaped_split - stringx.quoted_split - stringx.anim_split - stringx.join - stringx.join_map