strlwr -- Convert a String from Uppercase to Lowercase

SYNOPSIS

 #include <lcstring.h>

 char *strlwr(char *str);
 

DESCRIPTION

strlwr converts uppercase alphabetic characters ('A' through 'Z') in the input string str into lowercase characters ('a' through 'z'). All other characters are unchanged.

strlwr is not affected by the program's locale.

RETURN VALUE

strlwr returns the original input string pointer str.

CAUTION

You must properly terminate the input string with the null character; otherwise, a protection or addressing exception may occur.

EXAMPLE

  #include <lcstring.h>
  #include <stdio.h>
  #include <stdlib.h>

  main()
  {
     int i;
     char *names[5];

     puts("Enter 5 last names, using only uppercase letters:");
     for( i = 0; i < 5; i++){
        names[i] = ( char *)malloc(256);
        printf("Enter name no.%dn",i+1);
        gets(names[i]);
     }
        /* Convert each string in a table to lowercase letters. */
     puts("The names you have entered (converted to lowercase) "
          "are as follows:");
     for(i = 0; i < 5; i++)
        printf("%sn",strlwr(names[i]));
  }

 

RELATED FUNCTIONS

memlwr, strupr, strxlt

SEE ALSO

String Utility Functions

Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.