HOW TO

Convert a string to proper case in the ArcMap Field Calculator

Last Published: April 25, 2020

Summary

The instructions provided describe how to use the ArcMap Field Calculator to convert an uppercase, lower case or mixed case string to a proper case string. For example, a string is in one of the following formats:

  • hello world
  • HELLO WORLD
  • hELLO wORLD
Example of text field

For best results, use the Python expression option. The following example shows a way to convert words so that each word has the first character capitalized and the rest of the letters in lowercase. The Python function .title() is used in the workflow to achieve this objective.

Procedure

It is possible to convert a string to proper case by using Field Calculator on the desired field itself. However, it is recommended that a new field be created, rather than editing and using an existing field. This allows users to preserve the original data as a field calculation cannot be undone when performed outside an edit session. 

  1. Add a new field to the feature class in ArcMap.
    1. Open the layer's attribute table by right-clicking the layer in the Table of Contents and selecting Open Attribute Table.
    2. In the Table window, click the Options button and select Add Field....
    3. Assign a name and set the Type drop-down to Text. Make sure the field is big enough to store the values.
    4. Click OK in the Add Field dialog.
New field is added.
  1. Open the Field Calculator for the field created in Step 1 by right-clicking the new field name heading in the Table View and clicking Field Calculator.... Select the Python parser option in the upper right.
Select the Python parser.
  1. In the Field Calculator dialog box, select the desired field name to be converted for Fields, select String for Type, and select .title() for Functions. The code in the text box under 'New Field Name =' appears similar to the following: 
!FIELD_NAME!.title()
The code expression
  1. Click OK in the Field Calculator dialog box. In this example, the Python function .title() converts these strings to Hello World.
Result after converted
Note:
For information on equivalent steps in a label expression, or on performing this calculation in the ArcMap 9.3.1 or earlier Field Calculator, please see the link in the Related Links section below.

Article ID:000011159

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic