Solved

Converting an entire string to lowercase with tolower()

Posted on 2004-09-22
1
3,468 Views
Last Modified: 2008-01-09
Does anybody know how to convert an entire string to lowercase?  Would I have to run it through a for loop or will tolower() change the entire string.  I can seem to get my prog to compiile no matter what I do....


             length = endPos - startPos;
             word = word.substr(startPos,length);
            
            
            for(int j = 0; j < word.length(); j++)
            {
                  word = word.tolower(word[j]);      
            }
            
            cout << word << endl;
0
Comment
Question by:nothing8171
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
avizit earned 500 total points
ID: 12129324
one way is described in

http://www.msoe.edu/eecs/cese/resources/stl/string.htm

search for "transform" in that page


you need to #include <algorithm> for it to work

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question