LTrim operator in Python

1075
3
Jump to solution
10-31-2019 07:36 AM
SLouq
by MVP Regular Contributor
MVP Regular Contributor

What is the conversion in Python for LTrim and RTrim?

I would like to use them in my Field Calculator in ArcGIS Pro but they are not there

0 Kudos
1 Solution

Accepted Solutions
Per_Åke_MattiasWallin
New Contributor III

Scott,

I think you are looking for rstrip() and lstrip().

ArcGIS Pro field calculator:

Python example:

View solution in original post

3 Replies
Per_Åke_MattiasWallin
New Contributor III

Scott,

I think you are looking for rstrip() and lstrip().

ArcGIS Pro field calculator:

Python example:

SLouq
by MVP Regular Contributor
MVP Regular Contributor

Thank you!

0 Kudos
SLouq
by MVP Regular Contributor
MVP Regular Contributor

Another question.

I am trying to use the Mid() function in the field calculator.

!STR_NAME!.Mid(5, 20)

but it gives me a throwback error when I Run it

Can someone tell me why?

0 Kudos