Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

converting a basic_string to lowercase

This topic is 5862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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[i]);


Share this post

Link to post
Share on other sites
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]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!