Hi Team,
I have a regx code like
System.Text.RegularExpressions.Regex.Replace(SourceName,“^(THE|AND|)+”,“”)
The above code will remove the words THE & AND in a beginning of a line. it works fine.
Now i have a asset say (ExcemptKeywords) which has the words THE, AND, WAS… will be access these in a loop. My question is How to get this ExcemptKeywords asset variable inside this regx i tried like below but not working. Kindly help me to modify the below code.
System.Text.RegularExpressions.Regex.Replace(SourceName,“^(item.tostring)+”,“”)
Words (THE, AND, WAS) is coming from asset these values will be added using comma.
Using for loop reading the asset (item).
In the code below how to remove THE|AND… and place this item.tostring?
System.Text.RegularExpressions.Regex.Replace(SourceName,“^(THE|AND|)+”,“”)
Can you try with below code, i did not use asset instead i stored values in string,
then I retrieved THE AND from string using substring and stored in variables.
@Prasanth. Just explaining how i am using ur code. Confirm its right.
I am getting these asset values in - for loop.
Inside loop i have added your code.
In Test1 variable contains = “AND TESTING IN TEST”
ystem.Text.RegularExpressions.Regex.Replace(Test1,“^(”+string.Join(“|”,strText.Split(“,“c))+”)+”,“”)
I have used the above code its not working, correct me if i have done anything wrong here
Expected result is - TESTING IN TEST