I was doing a Field Calculation to remove the last 14 characters from every string in the field, and when I tried to verify the expression I got this error. Despite this, I was able to hit apply and the code worked as intended. Is this a bug, or is there something I'm not understanding here?
I don't use Arcade but
Text functions | ArcGIS Arcade | Esri Developer
has it being upper case which would be strange if arcade doesn't respect case.
Python slicing is an option (replace a and b with your field name enclosed in ! marks eg !name_field!
a = "abcdefghijklmnopqrstuvwxyz"
b = "abcde"
a[:14]
'abcdefghijklmn'
b[:14]
'abcde'
Thank you for your swift response! In the past i've not noticed any issues with case sensitivity in Arcade functions, but I realized after you had mentioned it that I had capitalized the Count function and not the Left function. Although it didn't seem to make a difference; I closed and reopened the project, rewrote the code exactly and it validated just fine. I think it must just be a bug...
I believe this arcade expression will work for you:
var txt = $feature.Label;
return Left(txt, Count(txt) - 14);
Replace the $feature.Label with $feature.Name - I believe it will work for you.