Split expression

Hello,
I am trying to split this expression AB+CD+123456+ABCDEFG ZXKV+01-Jan-2010+01-Jun-2050 and extract the last date mentioned in the expression… in this case that will be 01-Jun-2050.

Could you help me? I should mention also that this expression is a variable.
Tks

@georgiana.badea Will the Date be always in the Same Format ?

Hello :smiley:
You could use split function
VariableName.StringText.Split("+"c)(5)
in this case
image

2 Likes

VariableName.Split("+"c)(5) sorry this is the correct way

1 Like

Use this below code to get the last expression, @georgiana.badea
YourDate( variable type string) = System.Text.RegularExpressions.Regex.Matches(“AB+CD+123456+ABCDEFG ZXKV+01-Jan-2010+01-Jun-2050”,"[0-9-A-Za-z]+$")(0).ToString

1 Like

thank you @Lwissitoon, I should mention that the variable type is an array, in this case what is the form for the VariableName.Split("+"c)(5) ?

tks

Hello,
you could use
stringArray(index).Split("+"c)(5)
or
you can use a for each activity item.Split("+"c)(5)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.