Truncate list entries

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.

Capture

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”;

 

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