I have a scenario like. I am reading 5 address lines. In any of the lines i have to find a 5 digit word like DC123 (here DC is static and 123 will be dynamic say i may get DC859, DC254 etc…
In my if condition i have written as ex : item.ToString.Contans(“WC”)
My question is how to append reqular expression after WC which contains 3 dynamic numbers.
Can we put a reqular expression which contains any numerics 1to0 and concatinate with “WC” [or]
Include WC iteslf followed by 1to0 and assign it to a variable and replace it in the above code in “WC”
Can any body provide a need a sample line of code ?
Hi
There are many ways to do it
For example as per your wish with regex
Write this expression directly in a Writeline or assign activity we want “WC”+System.Text.RegularExpressions.Regex.March(“item.ToString”,”[\d].+”)
This will concatenate any digit value in item.ToStrjng with “WC” like this “WC123” from the string “DC123”
Or
We can use a simple Replace method like this
In a assign activity “WC” + item.ToString(“DC”,””).ToString
Kindly try this and let know for any queries or clarification
Cheers @Robotics