Solved

Converting an entire string to lowercase with tolower()

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixing C++ & C# in Vis Studio 2013 7 239
Best book to learn C++ 4 87
Dialogbox API leak? 18 109
FMX TCameraComponent Problem 2 93
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

726 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