From 7fd1e81154ce4c0520118fff64e54390c8ffbbd9 Mon Sep 17 00:00:00 2001 From: mryouse Date: Thu, 8 Jun 2023 18:43:00 -0400 Subject: initial commit of not-great strip --- core.neb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core.neb') 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 -- cgit v1.2.3