Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,18 @@
local s = "abracadabra"
local t = "abra"
local u = "ra"
local v = "cad"
print($"'{s}' starts with '{t}' is {s:startswith(t)}")
local indices = {}
local start = 1
while true do
local ix = s:find(u, start, true)
if ix then
indices:insert(ix)
start = ix + #u
if start > #s then break end
else break end
end
local contained = #indices > 0
print($"'{s}' contains '{u}' is {contained} {contained ? $"at indices {indices:concat(", ")}" : ""}")
print($"'{s}' ends with '{v}' is {s:endswith(v)}")