GetTokenName(string)
Description
Section titled âDescriptionâThe GetTokenName Lua function returns a string with the full keyword based on the short version string input or nil if there is no corresponding keyword.
Arguments
Section titled âArgumentsâ- String:
The string input should correspond to a short version of a keyword.
- String:
A string with the full keyword is returned.
- OR -
- Nil:
If there is no corresponding keyword, then nil is returned.
Example
Section titled âExampleâThis example returns the full keyword matching the short âseqâ string:
| Copy CodeLua |
| ``` |
| return function() |
-- Store a short string to be used as inputlocal shortToken = 'seq'-- Get the full token namelocal tokenName = GetTokenName(shortToken)-- Print useful output if nil is not returnedif tokenName ~= nil then Printf("The full version of '".. shortToken .. "' is '" .. tokenName .. "'")endend