Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an easier way to covert a string to lowercase?

Status
Not open for further replies.

consistomagus

Programmer
Aug 28, 2002
8
US
I am aware of the tolower function to convert a a single character to lowercase however is their a built in Function that allows you to covert an entire string to lowercase or vise versa?

Thanks
consistomagus
 
if you include windows.h, you can use:
- CharUpper (LPTSTR lpsz)
- CharLower (LPTSTR lpsz)
- CharUpperBuff ( LPTSTR lpsz, DWORD cchLength )
- CharLowerBuff ( LPTSTR lpsz, DWORD cchLength )

You must link with user32.lib if you use (one of) these functions. Marcel
 
You could also use _strlwr() / _strupr() functions

/JOlesen
 
Also, CString has a built in funciton to do it

CString::MakeUpper
CString::MakeLower

Matt

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top