Search results
Results from the WOW.Com Content Network
Values are interpreted as strings unless tonumber (value) isn't nil, i.e. numbers should be converted to the numeric type. No effort is made to interpret tables. No effort is made to interpret tables.
The English Wikipedia has several templates and Lua modules which can format or manipulate strings.In this context a "string" is any piece of text forming part of a page. This help page covers a few useful techniques; look in the navbox below for the full catalogue of templa
It supports only a small number of atomic data structures such as Boolean values, numbers (double-precision floating point and 64-bit integers by default) and strings. Typical data structures such as arrays , sets , lists and records can be represented using Lua's single native data structure, the table, which is essentially a heterogeneous ...
Note: Lua patterns are not regular expressions in the traditional POSIX sense, and they are not even a subset of regular expressions. But they share many constructs with regular expressions (more below). Lua patterns are used to define, find and handle a pattern in a string. It can do the common search and replace action in a text, but it has ...
A helper function that can be called from other Lua modules, but not from #invoke. This takes a string or a number value as input, and if the value can be converted to a number, cleanNumber returns the number and the number string. If the value cannot be converted to a number, cleanNumber returns nil, nil.
The string-search functions in Lua script can run extremely fast, comparing millions of characters per second. For example, a search of a 40,000-character article text, for 99 separate words (passed as 99 parameters in a template), ran within one second of Lua CPU clock time.
Using a value of 0 or 1 ensures-- that all JSON numeric data becomes strings in Lua.---- Note that unlike-- JSON.decodeNumbersAsObjects = true-- this stringification is simple and unintelligent: the JSON number simply becomes a Lua string, and that's the end of it.-- If the string is then converted back to JSON, it's still a string.
Invalid function name: len = string.long(my_str) - The string-length operator is hash mark '#' (as in: #my_str), or use function 'string.len(my_str)' but trying to use unknown function 'string.long(my_str)' will successfully pass during the pre-compile of edit-save, yet it will hit "Script error" when that portion of the Lua script is executed.