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

Rumman Ansari   Software Engineer   2024-07-05 04:31:21   7802  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

Table of Content:

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 . . .


Stay Ahead of the Curve! Check out these trending topics and sharpen your skills.