added some utility functions + fixed error in ostrAppendview
This commit is contained in:
parent
aa39e2563d
commit
be71719f73
7 changed files with 47 additions and 18 deletions
12
str.c
12
str.c
|
|
@ -263,6 +263,18 @@ str_t strToLower(str_t ctx) {
|
|||
return str;
|
||||
}
|
||||
|
||||
void strUpper(str_t *ctx) {
|
||||
for(size_t i = 0; i < ctx->len; ++i) {
|
||||
ctx->buf[i] = (char)toupper(ctx->buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
str_t strToUpper(str_t ctx) {
|
||||
str_t str = strDup(ctx);
|
||||
strUpper(&str);
|
||||
return str;
|
||||
}
|
||||
|
||||
// == STRVIEW_T ====================================================
|
||||
|
||||
strview_t strvInit(const char *cstr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue