Files
programming-lua/exercises/ch04/ex4_6.lua
2026-02-19 18:51:17 +02:00

10 lines
305 B
Lua

local function remove(str, start, length)
local slice_start = utf8.offset(str, start - 1)
local slice_end = utf8.offset(str, start + length)
local start_part = str:sub(1, slice_start)
local end_part = str:sub(slice_end)
return start_part .. end_part
end
print(remove("ação", 2, 2))