Module string
This is the Lua "string" standard module, as extended by blitwizard.
(Check here for the documentation of the Lua "string" standard functions)
In blitwizard, the "string" module contains a few additional functions as documented here. May they be useful to your game building!
Info:
- Copyright: 2011-2013
- License: zlib
- Author: Jonas Thiem (jonas.thiem@gmail.com)
Functions
split (string, delimiter, max_splits) | Split up a given string with a given delimiter, and return it as an array. |
startswith (examined_string, search_string) | Check if a given string starts with another. |
endswith (examined_string, search_string) | Check if a given string ends with another. |
Functions
- split (string, delimiter, max_splits)
-
Split up a given string with a given delimiter,
and return it as an array.
You can specify a maximum amount of splits to happen, otherwise the string will be split up as often as the delimiter was found (and you'll get delimiter+1 string parts).
Parameters:
- startswith (examined_string, search_string)
-
Check if a given string starts with another.
(The other string being shorter or the same length)
Returns true if the first specified string contains the second at the beginning, false if not.
Parameters:
- examined_string string the string of which you want to examine the beginning
- search_string string the starting string you search inside the examined string
Returns:
-
boolean
true if the search string matches the examined string's beginning, false if not
- endswith (examined_string, search_string)
-
Check if a given string ends with another.
(The other string being shorter or the same length)
Also compare to startswith
Returns true if the first specified string contains the second at the very end, false if not.
Parameters:
- examined_string string the string of which you want to examine the end
- search_string string the starting string you search inside the examined string
Returns:
-
boolean
true if the search string is the examined string's end, false if not