1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
local string = string
local s = {}
-- 加与删
--~ 文
--~ 前缀
function s.加前缀(o1, o2)
return (o2 or "") .. o1
end
-- 全筛
--~ 文
--~ 前缀
function s.全筛前缀(o1, o2)
if string.sub(o1, 1, #o2) == o2 then
return o1
end
end
return s
|
|
|
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
local string = string
local s = {}
-- 加与删
--~ 文
--~ 前缀
function s.加前缀(u1, u2)
return (u2 or "") .. u1
end
-- 全筛
--~ 文
--~ 前缀
function s.全筛前缀(u1, u2)
if string.sub(u1, 1, #u2) == u2 then
return u1
end
end
return s
|