So if the contents of the field is:
This is a test - This is a real test
You want to produce:
This is a test
This does not require using a script, but it can be scripted if you want:
If you do it manually, go to a layout where this field is accessible and do a Show All Records. Put the cursor in this text field and select Replace Field Contents. Select the calculation option and use this expression:
Let ( P = Position ( YourTextField ; "-" ; 1 ; 1 ) ;
If ( P ; Left ( YourTextField ; P - 1 ) ; YourTextField ) )
Since replace field contents can also be done in a script, this can also be scripted.
Oh yes, and make a back up copy of your file before you try this for the first time as this could modify every record in your table and cannot be undone.
Thank you, that worked perfectly!