Crystal Reports 2008 - Array - Only want part of text from Array

Hello,

I have a string parameter that allows multiple values. There are currently 20 options in our database, but there will be more than 20 in the future.

Crystal Reports 2008, Oracle 11.

Example of what string choices looks like:
HD  --High Definition
IP  --Backbone (IP)
L  --Lab/ Test sites

I am able to print what the user select in my page header by using the following formula:   Join ( {?p_SystemTypes} ,  ';   ' )
Example of what Join output looks like:
HD  --High Definition;   IP  --Backbone (IP);   L  --Lab/ Test sites

What I want to display is just the text before the "--"

Example of desired output:  HD; IP; L

Any ideas? Thanks guys.
LVL 14
LinInDenverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Try this code.

mlmcc
Local StringVar myString := Join({?Parameter},';';
Local StringVar Array myStringArray;
Local NumberVar i;

myStringArray := Split(myString,';');
For i := 1 to UBound(myStringArray) do
    myStringArray[i] := Split(myStringArray[i],'--')[1];

Join(myStringArray, '; ')

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LinInDenverAuthor Commented:
Thank you!! A parenthesis was missing on var mystring, but once added this does exactly what I need. Thank you!! Thank you!!

Local StringVar myString := Join({?p_SystemTypes},';');
Local StringVar Array myStringArray;
Local NumberVar i;

myStringArray := Split(myString,';');
For i := 1 to UBound(myStringArray) do
    myStringArray[i] := Split(myStringArray[i],'--')[1];

Join(myStringArray, '; ')
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.