How to use the less than < character in labelling expression?

200
1
05-27-2022 04:20 AM
VaL
by
New Contributor III

Hi,

I have a labelling expression that need to input the '<' character.

I also have some text formatting like

a="<CLR red = '255'> <SUP>1</SUP></CLR>"
if [Qualifier] =='<':
b=' \x3c'
return [PointID]+b+[maxres]+a

and adding < simply break everything.

If I dont use the formatting, < can be added.

So how do I escape it?

0 Kudos
1 Reply
JesseWickizer
Esri Contributor

The Text Formatting Tags help documentation says to use &lt; in place of an angle bracket and &amp; in place of an ampersand when using text formatting tags. Your formula becomes:

 

def FindLabel ( [Qualifier], [PointID], [maxres] ):
    a="<CLR red = '255'> <SUP>1</SUP></CLR>"
    if [Qualifier] =='<':
        b=' &lt;'
        return [PointID] + b + [maxres] + a

 

 

 

0 Kudos