This should be super simple to do, but it's driving me crazy. There doesn't seem to be any way of finding a subset of text in a string using Arcade. For example, all I need to do is find out if the word 'Lake' is in a feature name like 'Hurricane Lake FMA'. I can't believe I am having such a hard time with this, I could have done this in 5 seconds using javascript! Find won't work because it returns a number, and even if it returns 0 that is no help if the subtext I need to find starts at index 0. If someone could point out the obvious thing I am missing I would be grateful.
Solved! Go to Solution.
The Find Reference states that if no match is found it returns a value of -1 so that's how you key in on finding your substring
if (Find('380', 'Esri, 380 New York Street', 0) < 0) {
return 'Value not found';
} else {
return 'Value found';
}
Yes, I missed that the first time I checked the reference page, but finally saw it in another post and got it working. Thanks!
The Find Reference states that if no match is found it returns a value of -1 so that's how you key in on finding your substring
if (Find('380', 'Esri, 380 New York Street', 0) < 0) {
return 'Value not found';
} else {
return 'Value found';
}
Yes, I missed that the first time I checked the reference page, but finally saw it in another post and got it working. Thanks!