1

I have a label that I need to format using label expression. The label looks like this:

EVA09C

and I want the outcome to be this:

EA09C

Can I tell the label expression to skip the V in there?

  • 2
    Are your labels all formatted the same way? Is the letter you want to omit always in the second position? – lambertj Aug 8 '18 at 13:51
  • 3
    Unless I am going blind what "H" are you talking about, did you mean "V" as that is the only missing character in your desired output? – Hornbydd Aug 8 '18 at 13:55
  • Answers to this question and your very similar earlier one at gis.stackexchange.com/q/291478/115 appear to be pure Python (or pure VBscript) so will have already been answered multiple times at Stack Overflow if you do not find answers here before posting them. Only the way the Python Parser uses field name/value variables is different. – PolyGeo Aug 8 '18 at 20:00
  • Thank you for your comments. It is Always want to omit the second positions as lambertj says. And sorry Hronbydd I meant "V". Thanks for pointing that out PolyGeo. Sorry for unclear question. – GIS_Eva Aug 9 '18 at 6:10
3

One option would be this (replace FIELDNAME with the actual name of your field):

Replace([FIELDNAME], "V", "")

or

[FIELDNAME].replace("V", "")

if you prefer the Python parser.

1

Another solution that removes the second character:

def FindLabel ( [FIELDNAME] ):
    s= [FIELDNAME]
    return  s[0]+s[2:]

[Python parser]

1

Another solution

Left([FIELDNAME], 1) & Right([FIELDNAME], 4)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.