AnsweredAssumed Answered

Python string replace in a label

Question asked by tferguson78 on Mar 20, 2017
Latest reply on Mar 20, 2017 by tferguson78

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

Outcomes