wilcor14
asked on
Splitting variable into 2 values
I have the following value in the variable sExerciseStage:
The Motor Bike Starter(stage1)
I need "The Motor Bike Starter" to be assigned to a new variable sExercise
and the # "1" to be assigned to a new variable iStage
Can anyone help me split this? Thanks
The Motor Bike Starter(stage1)
I need "The Motor Bike Starter" to be assigned to a new variable sExercise
and the # "1" to be assigned to a new variable iStage
Can anyone help me split this? Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wilcor14,
We have both made assumptions about the source string...
For a bulletproof solution, answer these questions:
Will there always be a "(" after the first part?
Will there always be a trailing ")" at the end?
Will "stage" ALWAYS be before the number you want?
If "No" to either then please post some examples of the strings you need parsed...
We have both made assumptions about the source string...
For a bulletproof solution, answer these questions:
Will there always be a "(" after the first part?
Will there always be a trailing ")" at the end?
Will "stage" ALWAYS be before the number you want?
If "No" to either then please post some examples of the strings you need parsed...
ASKER
Idle_Mind,
Your assumptions are correct. I'm testing it right now and I think this will work perfect. Give me a few moments.
Your assumptions are correct. I'm testing it right now and I think this will work perfect. Give me a few moments.
ASKER
It works perfectly. Sorry for the delay. Thanks for your help.
System.Text.RegularExpress
Cheers!