Table of Contents

    strlwr() function in C : Convert String to Lowercase in C

    strlwr() function in C : Convert String to Lowercase in C

    strlwr() function converts a given string into lowercase. Syntax for strlwr( ) function is given below.

    Syntax

    char *strlwr(char *string);

    Important Note

    strlwr() function is non standard function which may not available in standard library in C.

    Program

    In this program, string "ATNYLA WANT TO MODIFY IN LOWER CASE" is converted into lower case using strlwr( ) function and result is displayed as "atnyla want to modify in lower case".

    
    #include <stdio.h>
    #include <string.h>
    int main()
    {
        char *p1 = "atnyla";
        char *p2;
        p2 = strdup(p1);
     
        printf("Duplicated string is : %s", p2);
        return 0;
    }
    

    Output

    atnyla want to modify in lower case
    Press any key to continue . . .