Cities... Do city names ever have any special characters besides a '.' ??

Status
Not open for further replies.

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
I'm working on a script to look at city names, and the format will be

CITY, STATEABBR

aka

St. Louis, MO

I'm thinking I'll just use the first ',' as the delimiter, and use everything to the left of the delimiter as the city name.

Do cities ever have commas in them?

Also, are there any common abbreviations in cities other than st. ?? St.= Saint
 

PepePeru

Diamond Member
Jul 21, 2005
3,846
0
0
Other common abbrevs.
Ft.
Pt.

I can't think of any city names with a comma.
 

FoBoT

No Lifer
Apr 30, 2001
63,084
14
81
fobot.com
there might be some with a ' in them
this is a French town, but there could be similar French names in Louisiana or somewhere

L'Haÿ-les-Roses
 

Chronoshock

Diamond Member
Jul 6, 2004
4,860
1
81
There will definitely be apostrophes (think Hawaiian cities) and dashes. I wouldn't be surprised if there were a few cities that have characters outside the English alphabet.
 

arcenite

Lifer
Dec 9, 2001
10,660
7
81
You're such a noob. If your string has more than one comma in it, use the last one as a delimiter. Of course this requires a little more thought, but it's not impossible.
 
Last edited:

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
Well, it seems the zip code database just has the cities in plain letters. No accents, abbreviations, etc.

aka

St. Louis is in the db as 'Saint Louis' and Ft. Lauderdale is 'Fort Lauderdale'

I did a search on Hawaii to see if there were any weird city names, and I didn't see a single one with any special characters.

They look like

'M C B H KANEOHE BAY'
 

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
You're such a noob. If your string has more than one comma in it, use the last one as a delimiter. Of course this requires a little more thought, but it's not impossible.

I figured as much.. I'm just wondering about how city names might be formatted..

in the db I am using they look like 'M C B H KANEOHE BAY'
 

arcenite

Lifer
Dec 9, 2001
10,660
7
81
I figured as much.. I'm just wondering about how city names might be formatted..

in the db I am using they look like 'M C B H KANEOHE BAY'

I have no idea what city that's supposed to be... OH, it's an abbreviation... that sucks for you :eek:
 
Jul 19, 2006
54
0
0
Are you only going to be reading the city names out of the database or will there be a user interface and you have to parse whatever the user typed in? Users will type in any crazy thing they want to. For cities, you will see stuff like this:
Phila.
Philly
FTW
Ft. Wo.
 
Status
Not open for further replies.