aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-329/hvukman/lua/329_p2.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-329/hvukman/lua/329_p2.lua b/challenge-329/hvukman/lua/329_p2.lua
new file mode 100644
index 0000000000..5cef522c4c
--- /dev/null
+++ b/challenge-329/hvukman/lua/329_p2.lua
@@ -0,0 +1,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") \ No newline at end of file