aboutsummaryrefslogtreecommitdiff
path: root/challenge-330/hvukman/lua/330_p1.lua
blob: 52efc57e2321771cbd3d9d2971a954e2b1e46a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function Nice (a)
    local not_good = false
    local new
    for i = 1, string.len(a) do
        local char = string.sub(a, i, i)
        if string.match(char, "%d") then
            new= string.sub(a, 1, i-2) .. string.sub(a, i+1, string.len(a))
            not_good= true
            break
        end

    end
    if not_good==true then
        return Nice(new)
    end
    print(a)
    return a
end

Nice("cab12")
Nice("xy99")
Nice("pa1erl")