aboutsummaryrefslogtreecommitdiff
path: root/challenge-329/hvukman/lua/329_p2.lua
blob: 5cef522c4c1468e0817a631e8b135b1fb52d580f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function Nice (a)
    print("string: ", a)
    for i = 1, string.len(a) do
        -- match upper and lower substring
        if string.find(a,string.upper(string.sub(a, i, i))) ~= nil and
         string.find(a,string.lower(string.sub(a, i, i))) ~= nil then
            io.write(string.sub(a, i, i))
        end
    end
    print("")
end

Nice("YaaAho")
Nice("cC")
Nice("A")