HOW TO

Insert a quotation mark into a label expression using Python

Last Published: October 21, 2020

Summary

The label expression dialog in ArcMap does not respect the exact standards of Python syntax. When trying to insert a quotation mark (") using an escape character, (for example "\""), an invalid expression error is returned. To get around this limitation and insert a quotation mark into a label, perform the following procedure.

Procedure

Use the Unicode character '\x22' in place of the quotation mark, as shown in the following two examples:

Simple label expression:

[Label] + '\x22'

Advanced label expression:

def FindLabel ( [Label] ):
  return [Label] + '\x22'

Article ID: 000012470

Software:
  • ArcMap

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options