# Parse a tagname

**URL:** <https://forum.inductiveautomation.com/t/parse-a-tagname/12307>\
**Category:** Ignition\
**Created:** [October 31, 2016, 6:13pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307 "2016-10-31T18:13:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![seancourtney](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@seancourtney](https://forum.inductiveautomation.com/u/seancourtney)\
**Post date:** [October 31, 2016, 6:13pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307/1 "2016-10-31T18:13:16Z")

</div>

I have a label that is using a tagname as its text. I want to parse it so the first two characters are not displayed.

For example.

My tagname is e\_XXXXXXXX. I want the label to disregard the “e\_” and only display the “XXXXXXXX”

any easy ideas?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 31, 2016, 6:18pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307/2 "2016-10-31T18:18:28Z")

</div>

Not sure if you’re doing this in an expression or scripting, but a simple substring function call should do it for you.

---

<div class="post-metadata">

**Author:** ![seancourtney](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@seancourtney](https://forum.inductiveautomation.com/u/seancourtney)\
**Post date:** [October 31, 2016, 6:26pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307/3 "2016-10-31T18:26:53Z")

</div>

the expression I am using is:

"Diverter Valve - " + {Root Container.instanceName}

{Root Container.instanceName} is e\_XXXXXXXXXX

I just want the XXXXXXXX

I cant seem to get the syntax correct.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [October 31, 2016, 6:32pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307/4 "2016-10-31T18:32:28Z")

</div>

Have you tried following the example at [the docs](https://docs.inductiveautomation.com/display/DOC79/substring)? If so, what was your code, and what happened?

---

<div class="post-metadata">

**Author:** ![seancourtney](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@seancourtney](https://forum.inductiveautomation.com/u/seancourtney)\
**Post date:** [October 31, 2016, 6:50pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307/5 "2016-10-31T18:50:31Z")

</div>

"Diverter Valve - " + substring{Root Container.instanceName,2}

Syntax error on Token “BOUND CONST”  
line 1 char 62.

I have tried several syntax combinations and cant seem to find the correct way.

---

<div class="post-metadata">

**Author:** ![seancourtney](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@seancourtney](https://forum.inductiveautomation.com/u/seancourtney)\
**Post date:** [October 31, 2016, 6:51pm UTC](https://forum.inductiveautomation.com/t/parse-a-tagname/12307/6 "2016-10-31T18:51:43Z")

</div>

Nevermind,

I got it.

thanks for pointing me in the right direction

Sean
