StendhalScripting/LuaAPI: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>AntumDeluge →entities: add link to Stendhal API |
imported>AntumDeluge →Table Manipulation: table.contains & table.join |
||
| Line 640: | Line 640: | ||
The following methods have been added to the built-in Lua [https://www.lua.org/manual/5.3/manual.html#6.6 table] library. |
The following methods have been added to the built-in Lua [https://www.lua.org/manual/5.3/manual.html#6.6 table] library. |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
{{PublicMethod | table.contains | params=table, o | desc=Checks if a table contains a value. | paramlist= |
|||
{{MethodParam | table | type=table | desc=Table to be checked.}} |
|||
{{MethodParam | o | desc=The object to check for.}} |
|||
| ret=<code>true</code> if <code>o</code> is in <code>table</code>. | rettype=boolean }} |
|||
; ''<span style="color:green;">table.clean</span>(tbl)'' |
; ''<span style="color:green;">table.clean</span>(tbl)'' |
||
| Line 646: | Line 656: | ||
: ''returns:'' Copy of <code>tbl</code> with <code>nil</code> values removed. |
: ''returns:'' Copy of <code>tbl</code> with <code>nil</code> values removed. |
||
{{PublicMethod | table.join | params=table, delim | desc=Joins a table of strings into a string. | paramlist= |
|||
| ⚫ | |||
{{MethodParam | table | type=table | desc=Table to be joined.}} |
|||
| ⚫ | |||
{{MethodParam | delim | type=string | desc=Character(s) to be used as separator.}} |
|||
| ⚫ | |||
| ret=The resulting string. | rettype=string }} |
|||
| ⚫ | |||
= See Also = |
= See Also = |
||