Definition | #include <string.h> char *strlower(char *s1, const char *s2);
If string s2 is passed as a NULL pointer, the copy operation is not performed and the uppercase letters in s1 are converted to lowercase. |
Return val. | Pointer to the result string s1. |
Notes | Strings terminated with the null byte (\0) are expected as arguments.
The behavior is undefined if memory areas overlap. |
Example | The following program copies the contents of s2 to s1, converting uppercase letters to lowercase in the process. #include <stdio.h>
#include <string.h>
int main(void)
{
char s1[] = " ";
char s2[] = "UPPERCASE!";
printf("Contents s2: %s\n", s2);
/* Copy s2 to s1 and convert to lowercase */
strlower(s1, s2);
printf("After strlower:\ncontents s1: %s\n", s1);
return 0;
}
|
See also | strupper, tolower, toupper |