aboutsummaryrefslogtreecommitdiff
path: root/core.neb
diff options
context:
space:
mode:
Diffstat (limited to 'core.neb')
-rw-r--r--core.neb9
1 files changed, 9 insertions, 0 deletions
diff --git a/core.neb b/core.neb
index 62e1069..308d9aa 100644
--- a/core.neb
+++ b/core.neb
@@ -13,6 +13,15 @@
"")
(last lst)))
+(func strip (str)
+ ; TODO need escape codes
+ (def whitespace (list " " " " "
+"))
+ (branch
+ ((in? (first str) whitespace) (strip (rest str)))
+ ((in? (last str) whitespace) (strip (most str)))
+ (#true str)))
+
; lists
(func slice (lst idx)
; TODO doesn't handle lengths