Good morning all,
I have some URL fields with different facing "\" "/" slashes that need to be lined up to "/". When using arcade in a web map to try and Replace "\" , "/", the \ is invalid and cannot be replaced. This makes it so the expression can't complete itself with red ' and black end ).
Basically I have URL text like BS\09802098.pdf that needs to end up BS/09802098.pdf. I also tried this on ArcPro end with python and received similar issues.
Any ideas?
Thanks
Solved! Go to Solution.
!CARDURL!.replace("\\", "/") # python
if CARDURL is a field name
!CARDURL!.replace("\\", "/") # python
if CARDURL is a field name
I think you need to specify '\\' so the backslash is properly returned
Replace($feature.CARDURL, '\\', '/')
I don't know for sure, but I bet you have to use an escape character or rather I bet the \ is being interpreted as an escape character. Have you tried '\\' yet? I think that should escape the backslash if I recall.
https://www.freecodecamp.org/news/escape-sequences-python/
https://linuxconfig.org/list-of-python-escape-sequence-characters-with-examples
look at my python example... the first \ is escaping the second \, so \\ means replace \ with /
Thanks all, \\ works in replace!