Hello,
I have a field that contains a street name with directional prefix for some of the streets (for example NE 1st St, N Cottonwood Ave, Willow St). I would like to extract just the street name without the directional (which may be 1 or 2 characters). I have been trying to write a script that returns the text after the first space, only if there is a space in the first three characters, or else returns the entire text.
I've tried it a couple of times and for both the statement validates, however neither work when executed.
For this script the results return NaN for all features that contained a space in the first three characters:
var addstreet = $feature['L0Parcel_boundaries.situs_street'];
var str3 = Left(addstreet,3);
var street = Trim(Second(Split(addstreet,' ')));
if((Find(' ',str3,0))>-1){
return street;
}else{
return addstreet
}
For the next attempt, the expression shows as valid but when it is executed it says the expression on line 4 is invalid:
var addstreet = $feature['L0Parcel_boundaries.situs_street'];
var str3 = Left(addstreet,3);
var street_array = Split(addstreet,' ');
var str = street_array[1];
if((Find(' ',str3,0))>-1){
return str;
}else{
return addstreet
}
I'm still a relative beginner with Arcade, so any assistance is appreciated.