First commit

This commit is contained in:
2026-02-19 18:51:17 +02:00
commit 2d9b2318a9
16 changed files with 358 additions and 0 deletions

13
exercises/ch04/ex4_4.lua Normal file
View File

@@ -0,0 +1,13 @@
local function insert(str, i, o)
i = utf8.offset(str, i)
local first_half = str:sub(1, i - 1)
local latter_half = str:sub(i, -1)
return first_half .. o .. latter_half
end
local function tests()
local res = insert("ação", 5, "!")
print(('insert("ação", 5, "!") --> %s'):format(res))
end
tests()