I'm scratching my head at this; I have an Arcade expression used to drive interstate labels that I'm trying to copy over to a label class for US highway labels. In the DOT's STATE_ROUTE fields, these are notated as 'I' and 'US' - for example, 'STATE OF IOWA, I 74 W' or 'STATE OF IOWA, US 6 W'. My expression finds those strings within the field and then returns the appropriate numbered route, if any. However, when I swap the I for US, I get an invalid expression error - wrong number of arguments. I'm not changing the number of arguments, though, and it works fine in the interstate label class. I feel like I'm missing something obvious, but I can't figure it out. I'm just copying the expression over.
Here is the (functional) expression used for interstates:
IIF(Find('STATE OF IOWA, I',$feature.STATE_ROUT)>='0',Split($feature.STATE_ROUT, ' ', 5, true)[4],IIF(Find('STATE OF IOWA, I',$feature.STATE_RO_1)>='0',Split($feature.STATE_RO_1, ' ', 5, true)[4]))
It successfully returns the digits of an interstate, such as '80' or '380'. If I swap the 'STATE OF IOWA, I' portions for 'STATE OF IOWA, US', it kicks me the error message. Same exact string otherwise.