Truncate list entries


#1

Hi all,

I’m looking to try and truncate names in a list. In simple terms I’m looking to reduce the list value to the value in brackets.

e.g. Glass (GLS) would just become GLS

Where there is no value in brackets I’d like it to convert to XXX

Is there a node that will do this kind of trickery?

 

Cheers

K.


#2

Capture


#3

This one line of code should do the trick

String.Contains(s,"(",false)?String.Substring(s,(String.IndexOf(s,"("))+1,String.IndexOf(s,")")-String.IndexOf(s,"(")-1):“XXX”;

 


#4

Both of these look like nice solutions - many thanks!!