Archived

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

Dark Rain

C++ equivalent of toupper, tolower?

Recommended Posts

I know that you can use a stringstream to transform numbers into a string or vice versa but is there something to do the equivalent of toupper on my std::string or a tolower. It just seems "barbaric" to me to use C functions calls in my C++ code ^_^.

Share this post


Link to post
Share on other sites
I haven''t found one, but yet again I haven''t done much searching. You might be able to find something in algorithm that executes a function on each element in the string, and you can set the function to upper or lower individual characters. I''m just throwing out ideas here

Share this post


Link to post
Share on other sites
This should work, tho I haven''t tested it.


  
#include <string>
#include <algorithm>
#include <cstring>

using std::transform;
using std::string;
using std::toupper;

transform(mystring.begin(), mystring.end(), // input range

mystring.begin(), // output range

toupper); // unary function object




Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
try this..


cout << leetsor hackers.
(&&#0kjdjskd
sldjf
af


Sorry if its sloopy, I had to much coffe this
morning

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
try this..


cout << leetsor hackers.
(&�kjdjskd
sldjf
af


Sorry if its sloopy, I had to much coffe this
morning

Careful, son... don''t get too close to it. It''s a retarded badger.


Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What is a retarded badger ?
Is that like a troll ?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
cout << leetsor hackers.
(&�kjdjskd
sldjf
af


Sorry if its sloopy, I had to much coffe this
morning
You can never have too much coffee. The problem is that you didn''t have enough.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You have been moderated. Have a nice day!

[edited by - Oluseyi on November 8, 2002 5:12:43 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You have been moderated again. Have a nice day!

[edited by - Oluseyi on November 8, 2002 5:13:09 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You have been moderated again, have
a GTA Vice City Day.

Props to Rockstar, it rules !!!

Que viva cuba libre !!!!


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Google?

A Google Gaga.

A Google Gaga, gew, gew, tickle , tickle , tickle,
google gaga.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How bout that video game Deadly Towers.
That sounds alot like tlower.

But what videos sounds alot like tupper
(oh, that''s a tuff one).


Erf !!!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dear GameDev,

I want to be a moderator.
What can I do to be employed as a moderator for you guys.
I hate these trolls.
I am posting anonymoouslysly because, I am scared they
might take my name and make fun of it.

I mean, look at what they did to UrangaTang, now
he''s known as OrangeBang


Thanks,
Concerned Citizen

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
does anyone, know how to
display int, in binary form ? (programmtically, not
using Calculator.exe)

COnsole will be fine

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
thank you ben-wilder-point.

Say, did you hear of that song by Paula Abdul..
"I''m forever your troll".

I want to be your forever troll, and eat your balls,
ha ha ha ha ha ha

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
not only have I failed in the C++ world, but
I''ve have failed as a troll to.

I mean, I have pissed no one off.

I bet people are ignoring this post, to try
to get rid of me.

I am hurt, and I am gonna cry.

My goal in life is to create flames.

Help me please !!!!

Share this post


Link to post
Share on other sites
so many anonymous posters here...
to AP who is afraid someone''s making fun out of his name, get a cool nick name, don''t use your real name if you don''t want to.


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Okay fine,

This is the AP.
Please do not make fun of my name.

Okay, we need to do something about these
trolls.
We need to fry them(deep fried),
and send them to mars, or far away
from earth.


Thank you very much
TinyWeaner

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.