操作方法

操作方法:在 ArcGIS Pro 中,将字符串字段中的大写单词转换为小写形式

Last Published: July 18, 2023

摘要

When using string functions such as title or replace in the Calculate Fields tool to replace an upper case letter with a lower case in a string field, only specific letters are replaced. To convert all upper case letters in a string field to lower case, use the .lower() function instead.

In this example, all the upper case letters under the CITY field of the attribute table are converted to lower case.

过程

Complete the steps below to convert all the upper case letters in a string field to lower case using the Calculate Fields tool.

  1. Open the project in ArcGIS Pro.
  2. In the Contents pane, right-click the layer with the attribute table, and click Attribute Table.
  3. In the attribute table, right-click the field with the upper case letters to be converted, and click Calculate Field Calculate Field. Ensure the Expression Type is Python3.
  4. Under the Expression section in the Calculate Field pane, select the field under Fields, and select the .lower() function from the Helpers list.
Note:
Set the filter to Text helper type to make the search for the .lower() function easier.

The expression reads as follows:

!<layer name>!.lower()

In this example, the expression reads:

!CITY!.lower()
Expression pane
  1. Click Run. When the tool completes, all the upper case letters of the field are converted to lower case.
Upper case letters converted to lower case
  1. Click the Save Edits button Save Edits button in the Calculate Field pane to save the changes.

文章 ID: 000022867

接收通知并查找新问题或常见问题的解决方案

从我们全新的 AI 聊天机器人中获得简明答案和视频解决方案。

下载 Esri 支持应用程序

相关信息

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项