summaryrefslogtreecommitdiff
path: root/meta/template/string.lua
blob: a7bfebe8e2b465965c7b3913b63690d07402dac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---@class string
string = {}

---@param s string
---@param i integer?
---@param j integer?
---@return integer
---@return ...
function string.byte(s, i, j) end

---@param byte integer
---@vararg integer
---@return string
---@return ...
function string.char(byte, ...) end

---@param f function
---@param strip boolean?
---@return string
function string.dump(f, strip) end

---@param s string
---@param pattern string
---@param init integer?
---@param plain boolean?
---@return integer start
---@return integer end
---@return ... captured
function string.find(s, pattern, init, plain) end

---@param s string
---@vararg string
---@return string
function string.format(s, ...) end

---@param s string
---@param pattern string
---@param init integer?
---@return fun():string, ...
function string.gmatch(s, pattern, init) end

---@param s string
---@param pattern string
---@param repl string|table|function
---@param n integer
---@return string
---@return integer count
function string.gsub(s, pattern, repl, n) end

---@param s string
---@return integer
function string.len(s) end

---@param s string
---@return string
function string.lower(s) end

---@param s string
---@param pattern string
---@param init integer?
---@return string captured
function string.match(s, pattern, init) end

---@param fmt string
---@param v1 string
---@param v2 string?
---@vararg string
---@return string binary
function string.pack(fmt, v1, v2, ...) end

---@param fmt string
---@return integer
function string.packsize(fmt) end

---@param s string
---@param n integer
---@param sep string?
---@return string
function string.rep(s, n, sep) end

---@param s string
---@return string
function string.reverse(s) end

---@param s string
---@param i integer
---@param j integer?
---@return string
function string.sub(s, i, j) end

---@param fmt string
---@param s string
---@param pos integer?
---@return ...
---@return integer offset
function string.unpack(fmt, s, pos) end

---@param s string
---@return string
function string.upper(s) end