aboutsummaryrefslogtreecommitdiff
path: root/core.neb
diff options
context:
space:
mode:
authormryouse2023-06-08 18:43:00 -0400
committermryouse2023-06-08 18:43:00 -0400
commit7fd1e81154ce4c0520118fff64e54390c8ffbbd9 (patch)
tree8118f6675f09957da358c1e24fee9b330b851b65 /core.neb
parentdd6bb60b82252ea34daeadc20abd1a6fefa6b69d (diff)
initial commit of not-great strip
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