Change character case with functions strlwr() and strupr(). - C String

C examples for String:String Function

Description

Change character case with functions strlwr() and strupr().

Demo Code

#include <stdio.h>
#include <string.h>

int main( void )
{
    char buf[80];

    while (1)//w  w  w  . ja v a2  s.c o m
    {
        puts("Enter a line of text, a blank to exit.");
         gets_s(buf);

        if ( strlen(buf) == 0 )
            break;

        puts(strlwr(buf));
        puts(strupr(buf));
    }
    return 0;
}

Result


Related Tutorials