How to extract Middle, Left, or Right characters in Calculate Field tool

39838
1
Jump to solution
07-06-2016 11:19 AM
BrianCohen
New Contributor III

What are the commands that replace the MID, LEFT, or RIGHT functions? For example, I need to extract the 2nd character from a 3 character string field named MOO, and populate the field COW with that value. Simple, I am sure, but ...?

0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

Have you checked out the Code samples -- Strings in the Field Calculator examples for ArcGIS Pro?

I encourage you to learn a bit of Python, which is what parser ArcGIS Pro is using.  In Python, strings are sequences that can be indexed, sliced, and much more.  In your case, the second character in a three character string is !string_field![1] .

View solution in original post

1 Reply
JoshuaBixby
MVP Esteemed Contributor

Have you checked out the Code samples -- Strings in the Field Calculator examples for ArcGIS Pro?

I encourage you to learn a bit of Python, which is what parser ArcGIS Pro is using.  In Python, strings are sequences that can be indexed, sliced, and much more.  In your case, the second character in a three character string is !string_field![1] .