implement strupper and strlower

Sat, 03 Sep 2022 15:11:23 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 03 Sep 2022 15:11:23 +0200
changeset 582
96fa7fa6af4f
parent 581
c067394737ca
child 583
0f3c9662f9b5

implement strupper and strlower

src/string.c file | annotate | diff | comparison | revisions
--- a/src/string.c	Sat Sep 03 14:56:07 2022 +0200
+++ b/src/string.c	Sat Sep 03 15:11:23 2022 +0200
@@ -430,3 +430,15 @@
                        suffix.ptr, suffix.length) == 0;
 #endif
 }
+
+void cx_strlower(cxmutstr string) {
+    cx_for_n(i, string.length) {
+        string.ptr[i] = tolower(string.ptr[i]);
+    }
+}
+
+void cx_strupper(cxmutstr string) {
+    cx_for_n(i, string.length) {
+        string.ptr[i] = toupper(string.ptr[i]);
+    }
+}

mercurial