Let's assume we have a tag field (called %origin% here) that can have one of these two forms :
Form 1 : %origin% = "XXX"
Form 2 : %origin% = "XXX (YYY)"
XXX and YYY being substrings of unknown length, composed of several words (i.e. with spaces) but without parenthesis.
My goal is to be able to display in each case ONLY the "XXX" part of %origin%.
Here's what I've come up to :
CODE
$if($strchr(%origin%,'(')),$left(%origin%,$sub($strchr(%origin%,'('),2)),%origin%)
But it doesn't work, and besides I think it's too complicated. Could you please have a look and tell me if there's something simpler ?
Thanks in advance.