Select to view content in your preferred language

How to remove spaces with Calculate field in ArcMap?

31997
10
04-21-2016 12:43 PM
LianaSmith
Frequent Contributor

My values are padded with spaces. Sometimes it's "1", sometimes it's " 1" sometimes its "1  ".

I need to remove all the spaces before, between, after, wherever they appear...

Thanks!!!!

0 Kudos
10 Replies
DanPatterson_Retired
MVP Emeritus

the method of parsing the data isn't clear... here is an example that can result in zeros before and after.

Just call it ... to bee or not to bee...

>>> bee = "B"

>>> "{!s:>04}".format(bee)

'000B'

>>> "{!s:<04}".format(bee)

'B000'

So the parser also needs to be clarified

0 Kudos