"BN14 5RY".split()[0] # or "BN1 5RY".split()[0]
If your field contains string/text data, there is no need for the len method in Python since string data is an "iterable". For example>>> a = "abcdefghijklmnop" >>> b = a[:-4] >>> b 'abcdefghijkl' >>>
>>> a = "abcdefghijklmnop" >>> b = a[:-4] >>> b 'abcdefghijkl' >>>
Hello,I have postcodes which I need to cut down from say BN14 5RY to only BN14. I cannot simply use the 'left(input, n)' equation as some postcodes are only 6 figures long such as BN1 5RY and I always need the first 3/4 characters.Does anyone know a way to delete the last 3 characters?Thanks in advance.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.