Select to view content in your preferred language

Double Quote in Label Expression

6221
20
Jump to solution
12-18-2014 07:00 AM
m_neer
by
Occasional Contributor

Hello,

Trying to get my label expression to work here.  The problem is some of my table

records have a double quote in it (" symbol).  I want to rename as such see example below:

(30" PVC Pipe Drain)  and rename it to (30 inch)

I use the following vbScript - but get nowhere:

Function FindLabel ( [NAME] )

If Not IsNull([NAME]) Then

NewStr = Replace([NAME], "30'' PVC Pipe Drain", "30 inch")

  FindLabel = NewStr

End If

End Function

  --- also I tried python and get nowhere:

def FindLabel ( [NAME] 😞

  S = [NAME]

  S = S.replace( '30'' Drain, Vitreous Clay Pipe', '30 in')

  return S

0 Kudos
20 Replies
JamesFitzgerald
Occasional Contributor II

Thanks! The code you all provided is very useful. I understand, and this will be very useful when I cannot not change the attributes to label.

Thanks

James

0 Kudos