From 85503025dd2bb807d37c68c9c9953e213c8dbbc3 Mon Sep 17 00:00:00 2001 From: CPunch Date: Sun, 17 Jan 2021 14:11:05 -0600 Subject: [PATCH] Added strings.cosmo example --- examples/strings.cosmo | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/strings.cosmo diff --git a/examples/strings.cosmo b/examples/strings.cosmo new file mode 100644 index 0000000..d1065dc --- /dev/null +++ b/examples/strings.cosmo @@ -0,0 +1,9 @@ +var words = "hello world! this is a sentence with words separated by space":split(" ") + +var str = "" +for (var i = 0; i < #words; i++) do + str = str .. words[i] + print(words[i]) +end + +print("\"" .. str .. "\"") \ No newline at end of file