Select to view content in your preferred language

Arcade labeling to return the characters before a dash.

1459
2
Jump to solution
05-18-2023 02:30 PM
IsaiasSegovia1
New Contributor

I'm trying to create an arcade expression to return all the characters before a dash. The field contains these values:

PE - Polyethylene

STL - Steel

AA - DuPont Aladyl-A

TR-418

I thought that this arcade code would help to label the line feature:

Trim(Left(DomainName($feature, 'MATERIAL'),3))

It help solve the issue with the steel, but this was no help since the TR-418 does not have a space between the R and dash, and it return "TR-".

Any ideas now how I can create this arcade code to label the line without the dash.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You can use Split to divide it at the dash and take the First value from that array

Trim(First(Split(DomainName($feature, 'MATERIAL'),'-')));

 

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

You can use Split to divide it at the dash and take the First value from that array

Trim(First(Split(DomainName($feature, 'MATERIAL'),'-')));

 

IsaiasSegovia1
New Contributor

It worked, thank you so much.

0 Kudos