Function name : strlwr
Header file : <string.h>
Function prototype : char *strlwr(char *str);
Function : Convert all uppercase letters in the string to lowercase
Parameters : str is the string to be converted
Return value : Returns the converted lowercase string, the essence of which is to return str.
Note : This function does not create a new string to return, but changes the original string. So it can only operate on character arrays, not pointer strings, because
The string pointed to by the pointer is stored in the static storage area as a constant, and the constant cannot be modified. This function is not a standard library function and can only be used under Windows.
(VC, MinGW, etc.), you need to define it yourself in Linux and GCC.
Program example: Convert uppercase characters in a string array to lowercase
#include<stdio.h>#include<string.h>intmain(void){charstr[20]=WWw.DoTCPP.COM;char*str2=strlwr(str);printf(%sn,str);return0 ;}
Running results:
www.dotcpp.com