aboutsummaryrefslogtreecommitdiff
path: root/src/ellinika/elmorph.scm4
diff options
context:
space:
mode:
Diffstat (limited to 'src/ellinika/elmorph.scm4')
-rw-r--r--src/ellinika/elmorph.scm419
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ellinika/elmorph.scm4 b/src/ellinika/elmorph.scm4
index 546bcb5..e3ed4b5 100644
--- a/src/ellinika/elmorph.scm4
+++ b/src/ellinika/elmorph.scm4
@@ -19,3 +19,22 @@
(load-extension
"LIBDIR/libguile-elmorph-v-VERSION"
"scm_init_ellinika_elmorph_module")
+
+(define-public (elstr-trim word n)
+ (cond
+ ((> n 0)
+ (elstr-slice word n (- (elstr-length word) n)))
+ ((< n 0)
+ (elstr-slice word 0 (+ (elstr-length word) n)))
+ (else
+ word)))
+
+(define-public (elstr-trim! word n)
+ (cond
+ ((> n 0)
+ (elstr-slice! word n (- (elstr-length word) n)))
+ ((< n 0)
+ (elstr-slice! word 0 (+ (elstr-length word) n)))))
+
+
+

Return to:

Send suggestions and report system problems to the System administrator.