I am trying to replace an ampersand with & in a label expression in ArcGIS Desktop 10.4.1
my current code is along these lines:
define FindLable([customer]):
return replace([customer], '&', '&')
For some reason this throws the following error: "Global name replace is not defined."
What is the correct format for this python code?
I have also tried str.replace and Replace and string.replace.
Thank you,
James
Solved! Go to Solution.
James, try:
def FindLabel ( [Status] ):
return [Status].replace('&', '&')
For the record: I am actually using define FindLabel spelled correctly.
James, try:
def FindLabel ( [Status] ):
return [Status].replace('&', '&')
That was it. Thank you Mathew.