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<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>customer<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">return</SPAN> replace<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>customer<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'&'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'&'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
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