Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Converting an entire string to lowercase with tolower()

Posted on 2004-09-22
1
Medium Priority
?
3,471 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

598 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