PDA

View Full Version : C++ to lower case string



cl333r
May 5th, 2009, 08:18 PM
Folks, I'm using Gtkmm, how do I convert a string to lower case?
There's Glib::ustring::lowercase but I can't figure out how to use it, any example please?

yep, thanks NintenDave, my problem was that I was mixing std::string with Glib::ustring

NintenDave
May 5th, 2009, 08:55 PM
Glib::ustring upper = "HeLlO";
Glib::ustring lower = upper.lowercase();

lensman3
May 6th, 2009, 04:44 AM
What is the STL lib or the boost equivalent?

I'm too lazy to look them up!

soltanis
May 6th, 2009, 05:23 AM
http://lmgtfy.com/?q=STL+strings+to+lower+case

salvachn
May 6th, 2009, 03:31 PM
If you deal only with ASCII strings, tolower() would do. Else you can write a function by yourself ;)