String functions

Experts,
        I am just starting to explore into the STL library and had questions about some inbuilt functions.

(1) How do I convert all the characters in a string to lower-case.
(2) How do I remove blank lines between words in a string
(3) How do I convert 2 words (part of a string) which are both in small caps into one where the first character in each word has large caps.
gvijay1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dsandfordCommented:
This is a duplicate question!
0
nietodCommented:
**************EXPERTS PLEASE NOTE*******************
This is a duplicate question probably asked by mistake.  Please do not answer here unless  gvijay1 indicates he/she wants an answer here.  Please post answers and comments on

http://www.experts-exchange.com/Computers/Programming/Languages/C++/Q_10264298.htm

instead.  

gvijay1 if this question was asked by mistake, delete it now and your points will be refunded.
0
danelroismanCommented:
you can use STL string member function

const E *c_str() const;
--------------------------

The member function returns a pointer to a nonmodifiable C string constructed by adding a terminating null element (E(0)) to the controlled sequence. Calling any non-const member function for *this can invalidate the pointer.

after this you can write somesing like this:

string myNewString =
_strlwr(_strdup(m_yourString.c_str()));

look about following functions in MSDN

_strlwr, _wcslwr, _mbslwr


0
danelroismanCommented:
you can use STL string member function

const E *c_str() const;
--------------------------

The member function returns a pointer to a nonmodifiable C string constructed by adding a terminating null element (E(0)) to the controlled sequence. Calling any non-const member function for *this can invalidate the pointer.

after this you can write somesing like this:

string myNewString =
_strlwr(_strdup(m_yourString.c_str()));

look about following functions in MSDN

_strlwr, _wcslwr, _mbslwr

2.

for remove blanks you can write utility function using the same way above:

char *  myNewChar = _strdup(m_yourString.c_str());

Run until '/0' and copy string ignoring
blanks.

your function can return new STL string



3.
It's hard to understand what the problem
!?
You can use solutions are above.


Daniel Roisman
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nietodCommented:
Daniel,

Did you read the question history?  You should read all the comments before you post an answer.  And if you did, then why did you post an answer?  This question can no longer be deleted.  This just cost gvijay1 30 points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.