Convert a string to lowercase.
#include <string.h> | Required only for function declarations |
char *_strlwr( char *string );
char __far * __far _fstrlwr( char __far *string );
string | String to be converted |
The _strlwr and _fstrlwr functions convert any uppercase letters in the given null-terminated string to lowercase. Other characters are not affected.
The _fstrlwr function is a model-independent (large-model) form of the _strlwr function. The behavior and return value of _fstrlwr are identical to those of the model-dependent function _strlwr, with the exception that the argument and return values are far pointers.
These functions return a pointer to the converted string. There is no error return.
_strlwr
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:DOS32X
_fstrlwr
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:None
/* STRLWR.C: This program uses _strlwr and _strupr to create
* uppercase and lowercase copies of a mixed-case string.
*/
#include <string.h>
#include <stdio.h>
void main( void )
{
char string[100] = "The String to End All Strings!";
char *copy1, *copy2;
copy1 = _strlwr( _strdup( string ) );
copy2 = _strupr( _strdup( string ) );
printf( "Mixed: %s\n", string );
printf( "Lower: %s\n", copy1 );
printf( "Upper: %s\n", copy2 );
}
Mixed: The String to End All Strings!
Lower: the string to end all strings!
Upper: THE STRING TO END ALL STRINGS!