Arcade: How to find string/phrase with apostrophe, ie. can't

559
2
Jump to solution
06-15-2021 07:05 AM
Labels (1)
KellyArmstrong
Occasional Contributor II

I am trying to find features that have value in a field that has an apostrophe.  How does one do this?

Here is what I have, but it won't work because of the apostrophe in Can't: 

 

else if ( $feature["media_type"] == 'Can't Find Curb Tie') {
return "Can't Find Curb Tie"
}

0 Kudos
2 Solutions

Accepted Solutions
ReeseFacendini
Esri Contributor

Try changing the single quotes to double quotes around the string you are trying to find

"Can't Find Curb Tie"

View solution in original post

jcarlson
MVP Notable Contributor

You can use "\" to escape individual characters, too, though simply swapping double quotes is probably simpler.

'Can\'t Find Curb Tie'
- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
ReeseFacendini
Esri Contributor

Try changing the single quotes to double quotes around the string you are trying to find

"Can't Find Curb Tie"

jcarlson
MVP Notable Contributor

You can use "\" to escape individual characters, too, though simply swapping double quotes is probably simpler.

'Can\'t Find Curb Tie'
- Josh Carlson
Kendall County GIS