Solved

Converting an entire string to lowercase with tolower()

Posted on 2004-09-22
1
3,465 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

786 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