using regex to uppercase certain words within strings ...
Posted: Tue Apr 03, 2007 4:21 pm
Good afternoon.
I apologize if this has been asked before but I am not sure what to search for.
I am parsing files uploaded by users that sometimes type in UPPERCASE ONLY. I can change the case of words with strtolower, ucwords, etc ... but how do I do the following?
Lets say that I ucwords a string "14 SSW OMAHA" ... this would then become "14 Ssw Omaha".
What do I need to do to make the "Ssw" into "SSW"
the possibilities are:
Nw
Ne
Sw
Se
Nnw
Nne
Ssw
Sse
Any help would be appreciated.
Thanks
G.
I apologize if this has been asked before but I am not sure what to search for.
I am parsing files uploaded by users that sometimes type in UPPERCASE ONLY. I can change the case of words with strtolower, ucwords, etc ... but how do I do the following?
Lets say that I ucwords a string "14 SSW OMAHA" ... this would then become "14 Ssw Omaha".
What do I need to do to make the "Ssw" into "SSW"
the possibilities are:
Nw
Ne
Sw
Se
Nnw
Nne
Ssw
Sse
Any help would be appreciated.
Thanks
G.