parseUtil
(For high level concepts about how to use Lua to write scripted tasks, please see VR-Forces User's Guide.)
Lua functions that assist with parsing of strings, especially from received messages.
To use functions in this package, reference parseUtil, e.g. parseUtil.fn(arg). For example,
require "parseUtil"
strTable = parseUtil.split(inputString, ",")
Function List
| split (inputString, delimiter) | Split the input string into substrings, using the given character as a delimiter. |
| wordSplit (inputString) | Split the input string into words, separate by spaces. |
Functions
- split (inputString, delimiter)
-
Split the input string into substrings, using the given character as a delimiter.
Parameters:
-
inputString: The string to split -
delimiter: The single character, or substring, used to split the input.
Return value:
- A table containing the substrings of the input string in each entry. The substrings will not include the delimiter character or substring. Leading spaces in each substring are removed.
-
- wordSplit (inputString)
-
Split the input string into words, separate by spaces. Return in a table.
Parameters:
-
inputString: The string to split
Return value:
- A table containing the words of the input string. Words are any contiguous sequence of non-space characters.
-
