Solved

Converting an entire string to lowercase with tolower()

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now