How to extract different strings from strings using UI Path

code

#1

Hello,

I have a string as

"(3194) Product1 Mix S 1kk description1 (15.12.2014 - ) (3194) Product2 Mix S 1kk description2 (17.12.2014 - ) (3194) Product3 Mix S 1kk description3 (16.12.2014 - )

I only want to extract (15.12.2014 - ) this part in different strings.

Please guide


#2

something like this?

strOutput= strInput.Split('(', ')')[1];


#3

Yes … How to do this in UI path. moreover I want all three dates

str1 = (15.12.2014 - )
str2 = (17.12.2014 - )
str3 = (16.12.2014 - )


#4

Try this

strInput.Split(New String() {"(",")"}, StringSplitOptions.None)(3)


#5

shall I try this inside assign activity.


#6

Yes and assign it to another String Variable.


#7

It gives error.

campaignSelector.Split(campaignDate, {’(’ , ‘)’}, StringSplitOptions.None)(3)

where campaignSelector is input string
Campaign date is new string


#8

It should be

string campaignDate = campaignSelector.Split(New String() {"(",")"}, StringSplitOptions.None)(3)


#9

Thankyou soo much
date is extracted. but it gives only one date.


#10

change the index values to get other dates, probably 6 and 9


#11

how you are calculating This index


#12

Please go through below link

https://www.dotnetperls.com/split