How to label mixed cases when the data originally in all caps?

2579
5
Jump to solution
03-10-2016 11:04 AM
EmilyLee
Occasional Contributor II

Hello,

Is there a way to label features in Mixed Cases when the data originally in all CAPS?

Original attribute table:

Currently, under Label Expression, I have:

"DISTRICT "& [DISTRICT] & vbnewline & [SUPERVISOR]

But I would like the label to look like this:

Any idea please?

Thank you very much!

Emily

0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

In the Label Expression, change the Parser to Python, and use the expression [Name].title() - if your field is called "Name".

View solution in original post

5 Replies
DarrenWiens2
MVP Honored Contributor

In the Label Expression, change the Parser to Python, and use the expression [Name].title() - if your field is called "Name".

RichardFairhurst
MVP Honored Contributor

Darren:

I am sure you meant to use exclamation marks for the field delimiters with the Python Parser and not brackets, which are used with the VB Parser.  So if the field is called "Name", the expression should instead be:

!Name!.title()

Capitalization will happen only for the first character at the beginning of the field and for the first alpha character that follows any white space, numbers, punctuation or special characters.  So you have to check for things like numbered streets which will appear as "1St Street" to make it "1st Street". Also, no alpha characters of a word other than the first one will be capitalized, so you have to check for things like Scottish last names beginning with Mc to change "Mcdonald" to "McDonald".  Also it capitalizes all words, including small words that normally are not capitalized in book titles like "a", "an", and "the".

DarrenWiens2
MVP Honored Contributor

No, the label expression dialog does it differently than the field calculator (convenient...). !Name!.title() results in an error.

RichardFairhurst
MVP Honored Contributor

You are correct.  I never do this with the label expression and only use the field calculator since I always want to correct the items I noted in my amended response, but a label expression works for the data in this case.

0 Kudos
EmilyLee
Occasional Contributor II

Thank you both Darren and Rich!

0 Kudos