Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
26
Task/Substring/Pluto/substring.pluto
Normal file
26
Task/Substring/Pluto/substring.pluto
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
require "uchar"
|
||||
|
||||
local s = uchar.of("αβγδεζηθ")
|
||||
local n = 3
|
||||
local m = 3
|
||||
local kc = "δ" -- known character
|
||||
local ks = "δε" -- known string
|
||||
-- For reference.
|
||||
print("Index of characters: 12345678")
|
||||
print($"Complete string: {s}")
|
||||
-- Starting from n characters in and of m length
|
||||
print($"Start {n}, length {m}: {s:sub(n, n + m - 1)}")
|
||||
-- Starting from n characters in, up to the end of the string
|
||||
print($"Start {n}, to end: {s:sub(n)}")
|
||||
-- Whole string minus last character.
|
||||
print($"All but last: {s:sub(1, -2)}")
|
||||
-- Starting from a known character within the string and of m length.
|
||||
local dx = s:find(kc)
|
||||
if dx then
|
||||
print($"Start '{kc}', length {m}: {s:sub(dx, dx + m - 1)}")
|
||||
end
|
||||
-- Starting from a known substring within the string and of m length.
|
||||
local sx = s:find(ks)
|
||||
if sx then
|
||||
print($"Start '{ks}', length {m}: {s:sub(sx, sx + m - 1)}")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue