I was going down the same path. Really appreciate the quick reply. 

This is what I was testing successfully so far. 

var text = 'test - remove';
gs.print(text.split(' - ')[0]);

What are your thoughts between the two?