I finally have a new laptop and it's about to be a new fiscal year, so I am starting off my new GIS project with a clean slate--as in I'm kicking all my kludged together maps and bloated geodatabase with dozens and dozens of orphaned items to the curb. I have been putting off using Arcade, but since I also plan on publishing more content to our portal, I want to start using it to make life easier for those online maps.
My current dilemma is that I can't figure out how to manipulate a label string the way I need to. I have a field (Office Name) that includes the City and State. To make labelling easier, I want to remove the last three characters in that field, which is a space and then the two character state abbreviation. With Python, I can do it thusly:
def FindLabel ( [OFC_NM] ):
L = [OFC_NM]
L = L.title()
L = L[:-3]
How the heck do I this (properly) with Arcade?
arcade formatting arcade language string.format
Thanks for the reply, Joe. Unfortunately those functions don't do what I need to be done, at least not as they are written/documented in the help file. I actually played around with that prior to my post (should've mentioned that in my original post.)
Although using the Left function would give me the characters to the left of the string, which is what I need, there is no consistent length to the office names.
Python deals with this type of situation by allowing you to use negative numbers so using something like
L = "New Orleans, LA"
gives you "New Orleans" when the string in the field is "New Orleans, LA". I tried using the same logic with Arcade
Right('New Orleans, LA', -3)
But that does not work and the labels don't actually render.