[GIS] how to use the TRIM function in field calculator

arcgis-desktopfield-calculator

I need to remove leading spaces in a field in my attribute table, but not how to do it from the field calculator

Best Answer

with python parser, you can use replace to remove ALL spaces

!myfield!.replace(" ","")

or, if you want to trim the first spaces only, you can use

!myfield!.lstrip()

Note that LTrim will work in vb

LTrim([myfield])