Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Upper and lower case headache

New Here ,
Feb 25, 2009 Feb 25, 2009
I'm facing a rather challenging situation where I think I need help.
If I'm given an address string, I need to make sure they're showing up in our applicaion in a proper cases, for example: If I have an address such as 123 WHATEVER AVE. SOMECITY CA 91827 (no comma) or
H123-303, WHATEVER AVE., SOMECITY, CA 91827, USA (with comma) or
similar address but all with lower case, I need to make it proper such as:
1. 123 Whatever Ave. Somecity CA 91827 OR
2. H123-303, Whatever Ave. Somecity, CA 91827, USA

Is there a way to do this?
TOPICS
Getting started
831
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 25, 2009 Feb 25, 2009
WenAhu wrote:
>
> Is there a way to do this?
>

Yes, but not easily.

Where you have to start is to:

1) look at lots and lots and lots of different examples of the data you
expect to get.

2) The start working out the rules for how you would case the string as
desired.

3) Start to realize that these rules are going to long, complex and have
tons of exceptions.

4) Go back to whoever is paying you to do this and make sure they want
to pay you this much for some pretty formating. And suggest there is
really a reason that large organizations like the US Postal service deal
with such strings by making them ALL CAPS!

5) If they come back yes, look around to see if anybody has already
tackled this well and if you can afford their solution.

6) Start to work out your logic tree for the rules you developed.

7) Sell this to all future people who do not want to work this hard to
solve such a complex and challenging problem.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 25, 2009 Feb 25, 2009
LATEST
There's all kinds of "capitalize first letter of each word" functions and scripts out there. E.g.:

http://cflib.org/index.cfm?event=page.udfbyid&udfid=889

Though in your case, you'd have to add some exception logic to not do this to State and Country abbreviations.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources