Export (0) Print
Expand All
Expand Minimize

_strlwr, _wcslwr, _mbslwr

Convert a string to lowercase.

char *_strlwr(
   char *string 
);
wchar_t *_wcslwr(
   wchar_t *string 
);
unsigned char *_mbslwr(
   unsigned char *string 
);

Parameters

string
Null-terminated string to convert to lowercase.

Return Value

Each of these functions returns a pointer to the converted string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument. No return value is reserved to indicate an error.

Remarks

The _strlwr function converts any uppercase letters in string to lowercase as determined by the LC_CTYPE category setting of the current locale. Other characters are not affected. For more information on LC_CTYPE, see setlocale.

The _wcslwr and _mbslwr functions are wide-character and multibyte-character versions of _strlwr. The argument and return value of _wcslwr are wide-character strings; those of _mbslwr are multibyte-character strings. These three functions behave identically otherwise.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_tcslwr _strlwr _mbslwr _wcslwr

Requirements

Routine Required header Compatibility
_strlwr <string.h> Win 98, Win Me, Win NT, Win 2000, Win XP
_wcslwr <string.h> or <wchar.h> Win 98, Win Me, Win NT, Win 2000, Win XP
_mbslwr <mbstring.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

// crt_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>

int 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 );
}

Output

Mixed: The String to End All Strings!
Lower: the string to end all strings!
Upper: THE STRING TO END ALL STRINGS!

See Also

String Manipulation Routines | Locale Routines | _strupr | Run-Time Routines and .NET Framework Equivalents

Show:
© 2014 Microsoft