converting a basic_string to lowercase

Started by
2 comments, last by wild_pointer 21 years, 11 months ago
uh, sorry, but i can''t seem to figure out how to do this. looked at msdn and sgi.
[size=2]
Advertisement
this may not be the best way, but it''s a way:

basic_string myStr;
int i;

for (i = 0; i < myStr.size (); i++)
{
myStr = tolower(myStr);<br><br>}<br> </i>
std::transform( str.begin(), str.end(), str.begin(), std::tolower);

[Questions (STFW) | GDNet Start Here | GDNet Search | Forum FAQ | Google | Asking Smart Questions ]
[Docs (RTFM) | MSDN | SGI's STL | OpenGL | File formats]
[C++ Must Haves (RTFS) | MinGW | Boost | Loki | FLTK | SDL ]

Stolen from Magmai Kai Holmlor, who held it from Oluseyi, who was inspired by Kylotan...

[edited by - Fruny on May 1, 2002 12:24:06 AM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
ah, thank you fruny
[size=2]

This topic is closed to new replies.

Advertisement