Sat, 03 Sep 2022 15:11:23 +0200
implement strupper and strlower
src/string.c | file | annotate | diff | comparison | revisions |
1.1 --- a/src/string.c Sat Sep 03 14:56:07 2022 +0200 1.2 +++ b/src/string.c Sat Sep 03 15:11:23 2022 +0200 1.3 @@ -430,3 +430,15 @@ 1.4 suffix.ptr, suffix.length) == 0; 1.5 #endif 1.6 } 1.7 + 1.8 +void cx_strlower(cxmutstr string) { 1.9 + cx_for_n(i, string.length) { 1.10 + string.ptr[i] = tolower(string.ptr[i]); 1.11 + } 1.12 +} 1.13 + 1.14 +void cx_strupper(cxmutstr string) { 1.15 + cx_for_n(i, string.length) { 1.16 + string.ptr[i] = toupper(string.ptr[i]); 1.17 + } 1.18 +}