Apply #70: Add StrLower() function.

This commit is contained in:
Jordan Bancino 2023-06-12 14:10:59 +00:00
parent eb3732a2cd
commit 179e16ed24
2 changed files with 35 additions and 0 deletions

View file

@ -277,6 +277,32 @@ StrInt(long i)
return str;
}
char *
StrLower(char *str)
{
char *ret;
size_t len;
size_t i;
if (!str)
{
return NULL;
}
len = strlen(str);
ret = Malloc(len + 1);
for (i = 0; i < len; i++)
{
ret[i] = tolower(str[i]);
}
ret[len] = '\0';
return ret;
}
int
StrEquals(const char *str1, const char *str2)
{