C Programming Language            

string function : strlwr()

Syntax:
char * strlwr(char *str)

strlwr(str) coverts str to all lowercase.

This function will convert all the uppercase characters in the string, which is provided as parameter, into lowercase. It does not take care whether it is the starting letter or not. It will convert every uppercase to lowercase.

For example

#include<stdio.h>
#include<conio.h>
int main()
{   
    char str[30]="www.CProgrammingExpert.com";           
    clrscr();
    printf("\n\nstr : %s\n\n",str);
    printf("strlwr(str) : %s\n",strlwr(str));
    getch();
    return 0;
}

here we declares the string str like this str[30]="www.CProgrammingExpert.com"; The string str is a character array of size 30.The character is stored like this



str[0]  <- 'w'
str[1]  <- 'w'
str[2]  <- 'w'
str[3]  <- '.'
str[4]  <- 'C'
str[5]  <- 'P'
str[6]  <- 'r'
str[7]  <- 'o'
str[8]  <- 'g'
str[9]  <- 'r'
str[10]   <-'a'                   
str[11]   <-'m'   
str[12]   <-'m'   
str[13]   <-'i'   
str[14]   <-'n'   
str[15]   <-'g'   
str[16]   <- 'E' 
str[17]   <- 'x'
str[18]   <- 'p'
str[19]   <- 'e'
str[20]   <- 'r'
str[21]   <- 't'
str[22]   <- '.'
str[23]   <- 'c'
str[24]   <- 'o'
str[25]   <- 'm'
str[26]   <- '\0'
str[27]   <- 'garbage value'
str[28]   <- 'garbage value'
str[29]   <- 'garbage value'

when we use the function strlwr(str) it will convert all characters stored in the character array str to lowercase.Then stored like this

str[0]  <- 'w'
str[1]  <- 'w'
str[2]  <- 'w'
str[3]  <- '.'
str[4]  <- 'c'
str[5]  <- 'p'
str[6]  <- 'r'
str[7]  <- 'o'
str[8]  <- 'g'
str[9]  <- 'r'
str[10]   <-'a'                   
str[11]   <-'m'   
str[12]   <-'m'   
str[13]   <-'i'   
str[14]   <-'n'   
str[15]   <-'g'   
str[16]   <- 'e' 
str[17]   <- 'x'
str[18]   <- 'p'
str[19]   <- 'e'
str[20]   <- 'r'
str[21]   <- 't'
str[22]   <- '.'
str[23]   <- 'c'
str[24]   <- 'o'
str[25]   <- 'm'
str[26]   <- '\0'
str[27]   <- 'garbage value'
str[28]   <- 'garbage value'
str[29]   <- 'garbage value'

so after using the function strlwr(str) the value of string str is"www.cprogrammingexpert.com"

Example:

string function  
strlen() Home strupr()