Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

strlower - Copy a string and convert to lowercase letters

&pagelevel(4)&pagelevel

Definition    

#include <string.h>

char *strlower(char *s1, const char *s2);

strlower copies string s2 (including the null byte (\0)) to string s1, converting uppercase letters to lowercase letters in the process.

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.

strlower does not check whether s1 is large enough for the result. If s1 is shorter than s2 (including the null byte), the memory space after s1 is overwritten!

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