How about this expression
System.Text.RegularExpressions.Regex.Match(YourString,"\d.+").Tostring
System.Text.RegularExpressions.Regex.Match(YourString,"\S+(?=\swith)").Tostring
Regards
Gokul
You can also try with Split method
Split("nikhil with 89.65","with")(0)
Split("nikhil with 89.65","with")(1)
You need output like this nikhil-89.65
you can try with this expression
System.Text.RegularExpressions.Regex.Replace(YourString,"\swith\s","-").Tostring
Hi @katta_nikhil ,
Maybe you could also try with a Regex Replace if the pattern is always the same :
(.*)(\swith\s)([0-9.,]+)
Expression :
System.Text.RegularExpressions.Regex.Replace(wordText,"(.*)(\swith\s)([0-9.,]+)","$1-$3")
Let us know if the data differs and if so provide us a sample where the regex provided is failing.
1 Like
hi … i known how to do with split method… but i am leraning the regex expression so …
I have also mentioned the Regex expression in the above post. Check it out.
For Learning Regex check out the below tutorial
Regards
Gokul
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.