Chapter Contents

Previous

Next
strlwr

strlwr



Convert a String from Uppercase to Lowercase

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTION
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


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.%d\n",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("%s\n",strlwr(names[i]));
}


RELATED FUNCTIONS

memlwr , strupr , strxlt


SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.