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

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options