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?





This one line of code should do the trick



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