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
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