Sat, 03 Sep 2022 15:11:23 +0200
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]); + } +}