mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 05:24:10 +03:00
feat: add string data type api
This commit is contained in:
1 parent
99d67fa4cb
commit
0b4e2075e4
1 file changed
+33
@@ -78,6 +78,8 @@ Lua is a dynamically typed language and hence only the values will have types no
|
||||
| `thread` | Represents independent threads of execution |
|
||||
| `table` | key-value pair, or array. |
|
||||
|
||||
See: [Data Types](#data-types)
|
||||
|
||||
## Operators
|
||||
|
||||
### Arithmetic
|
||||
@@ -151,3 +153,34 @@ true or false --> true
|
||||
not true --> false
|
||||
|
||||
```
|
||||
|
||||
## Data Type APIs
|
||||
|
||||
### Strings
|
||||
|
||||
```lua
|
||||
s = "Hello"
|
||||
|
||||
-- concatenation
|
||||
s .. " there" -- => Hello there
|
||||
|
||||
s:upper() -- => HELLO
|
||||
s:lower() -- => hello
|
||||
s:len() -- => 5
|
||||
s:find("o") -- => 5
|
||||
s:reverse() -- => olleH
|
||||
|
||||
-- others
|
||||
s:match()
|
||||
s:gmatch()
|
||||
|
||||
s:sub()
|
||||
s:gsub()
|
||||
|
||||
s:rep()
|
||||
s:char()
|
||||
s:dump()
|
||||
s:byte()
|
||||
s:format()
|
||||
|
||||
```
|
||||
Reference in new issue
Block a user