String Help

Printed From: Crystal Reports Book — Forum Name: Technical Questions

I am trying to separate a string into its individual parts and somewhere I am missing a step.

Problem:
I have a text field 'Contract Number' which is actually 'Contract Number' - 'Description' and I need to remove the dash and Description from the text string.

Limitations:
I cannot key off the dash because the contract number may also contain a dash or more than one dash.
I cannot Trim Left because the contract number may be a variety of lengths depending on the contract.

I can access the Description field separately. I have tried comparing and removing the Description field, I tried counting the characters in the Description and then trimming. Somewhere I am missing something.

Can anyone point me in the right direction?
So the question is, are there any dashes in the comments?  If not.  you could use inStrRev to find the first dash.  Otherwise  I am not sure how you would find it unless you do some sophisticated parsing of the data (i.e., if there is a number after the dash ignore it, but if there is a space then flag it).