StendhalScripting/LuaAPI: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>AntumDeluge →arrays: clean up |
imported>AntumDeluge →String Manipulation: new methods "string.isNumber" & "string.builder" |
||
| Line 262: | Line 262: | ||
The following methods have been added to the built-in Lua [https://www.lua.org/manual/5.3/manual.html#6.4 string] library. |
The following methods have been added to the built-in Lua [https://www.lua.org/manual/5.3/manual.html#6.4 string] library. |
||
; ''<span style="color:green;">string.startsWith</span>(st, prefix)'' |
|||
: Checks if a string begins with a set of characters. |
|||
: '''''st:''''' The string to be checked. |
|||
: '''''prefix:''''' The prefix to be compared with. |
|||
: ''returns:'' <code>true</code> if <code>prefix</code> matches the beginning characters of <code>st</code>. |
|||
:; ''aliases:'' |
|||
| ⚫ | |||
:: <span style="color:green; font-style:italic;">string.beginsWith</span> |
|||
** This is just an alias for <code>string.startsWith</code>. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
** <span style="color:darkgreen; text-style=italic;">st:</span> The string to be trimmed. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
** <span style="color:darkgreen; text-style=italic;">st:</span> The string to be trimmed. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
: '''''st:''''' The string to be checked. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
: Checks if a string contains numeric characters only. |
|||
: '''''st:''''' The string to be checked. |
|||
: ''returns:'' <code>true</code> if all characters are numeric, <code>false</code> otherwise. |
|||
:; ''aliases:'' |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
: '''''st:''''' The string to be trimmed. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
: '''''st:''''' The string to be trimmed. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
: '''''st:''''' The string to be trimmed. |
|||
| ⚫ | |||
; ''<span style="color:green;">string.builder</span>(st)'' |
|||
: Creates a new instance of [https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html java.lang.StringBuilder]. |
|||
: '''''st:''''' (optional) String to append on instantiation. |
|||
: ''returns:'' new StringBuilder instance. |
|||
== Table Manipulation == |
== Table Manipulation == |
||