converting from all-caps to caplitalized words.

D

darrel

I'm creating a form for people to enter in news items. Unfortunately, most
of these come formatted with all-caps headlines:

THIS IS THE HEADLINE TO THE ARTICLE

Which is annoying, to say the least.

Upon going into the DB, I want to convert that to:

This Is The Headline To The Article

I thought this woud be simple, but now I realize I don't know how to best
handle this. I can use a regex to find all all-caps words longer than one
letter:

([A-Z][A-Z]+)

But I'm not sure how to convert it into what I want.

I can also do string manipulation:

LCase(myString)

but that converts all characters, and doesn't leave me with capitalized
words. I could then loop back through the string looking for instances of
'space + letter + one or more letters...) and convert those back to
uppercase, but then I'm thinking I'm doing something way more complicated
than it should be.

Or maybe it's just because it's monday end of day and my brain is fried.

Anyways, am I missing an obvious solution for this?

-Darrel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top