How To: Convert a string to proper case in the ArcMap Field Calculator
The procedure below is for ArcGIS 9.3.1 or earlier versions. Starting at ArcGIS 10.0, expressions in the Field Calculator are created using only VBScript or a standard Python format.
Instructions provided describe how to use the ArcMap Field Calculator to convert an upper case, lower case or mixed case string to proper case. For example, a string that is in the following formats:
- "hello world"
- "HELLO WORLD"
- "hELLO wORLD"
The VBA function "StrConv" converts the string to: "Hello World".
For information on how to do the equivalent steps in a label expression, please see the link in the Related Information section below.
- Add a new text field to the attribute table to store the new string values.
- If in editing mode, stop the current editing session.
- Open the feature's attribute table.
- Click Options.
- Click Add Field.
- Name the field.
- Type: Text.
- Set the Length property.
- Open the ArcMap Field Calculator for the field created in the step above by right-clicking the new field name heading in the Table View and click Calculate Values.
- In the Field Calculator dialog box, type the following code in the text box under "Your Field Name = "
StrConv([Existing Field], vbProperCase)
Change [Existing Field] to match the name of the existing field that contains the string values that are not currently in the proper case.
- Click OK in the Field Calculator dialog box.
Article ID: 000008832
Software: ArcGIS - ArcEditor 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcInfo 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcView 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1