You can't do string modification at all in the UI.
You can't parse for "X", and you can't truncate things you don't want from a string.
There exists tricks for some small situations, but I haven't looked at this closely enough to give a better answer. For example, you could do "full" string comparison, and create checks for every possible combination
(usually a lot of work)