This is in the standard library, and this is the most direct way that I see to implement such a function. So yes, just loop over the string and convert each character to lowercase.
Something like that
#include <ctype.h> for(int i = 0; str[i]; i++){ str[i] = tolower(str[i]); }
or, if you prefer a single liner, you can use this variant of JF Sebastian:
for ( ; *p; ++p) *p = tolower(*p);
Earlz Apr 18 '10 at 9:44 2010-04-18 09:44
source share