aboutsummaryrefslogtreecommitdiff
path: root/ExtraString.icl
diff options
context:
space:
mode:
authorCamil Staps2016-03-02 23:40:25 +0100
committerCamil Staps2016-03-02 23:40:25 +0100
commit2856828c645aa868f9a1caa439cab535427d1f58 (patch)
tree122499e16872beb99284e74955e6a157a5e51807 /ExtraString.icl
parentMoved runflags to clmflags (diff)
Implemented memory
Not release ready: - Cannot forget things - Not documented in Readme
Diffstat (limited to 'ExtraString.icl')
-rw-r--r--ExtraString.icl21
1 files changed, 21 insertions, 0 deletions
diff --git a/ExtraString.icl b/ExtraString.icl
new file mode 100644
index 0000000..740e8d2
--- /dev/null
+++ b/ExtraString.icl
@@ -0,0 +1,21 @@
+implementation module ExtraString
+
+import StdEnv
+
+matches :: !String !String -> Bool
+matches needle haystack = haystack % (0, size needle - 1) == needle
+
+skip :: !Int !String -> String
+skip i s = s % (i, size s - 1)
+
+join :: !String ![a] -> String | toString a
+join del [] = ""
+join del [s:ss] = toString s +++ del +++ join del ss
+
+:: TextColor = Red | Green | None
+
+color :: TextColor !String -> String
+color Red s = "\x1B[31m" +++ s +++ "\x1B[0m"
+color Green s = "\x1B[32m" +++ s +++ "\x1B[0m"
+color None s = "\x1B[0m" +++ s +++ "\x1B[0m"
+