Reputation: 258
I want to replace my code with regular expression in the entire solution, but I can't find the whole message using a regular expression. I try that regular expression is "Convert.ToString(+MessageContext.Get([".a-zA-Z0-9]+"
Example.
I want to replace "Convert.ToString(MessageContext.Get("Dynamic Message"))" this code with "MessageContext.Get("Dynamic Message")" but i can't achieve exact this.
please help me with this.
Upvotes: 0
Views: 180
Reputation: 1157
For this type of regex replace in visual studio you need to create a Group
ex:
(Convert.ToString\()+(MessageContext.get\([".a-zA-Z0-9]+)+(\){1})(\))
Now you can easily replace
(Convert.ToString\()+(MessageContext.get\([".a-zA-Z0-9]+)+(\){1})(\))
with
$2$3
final output
MessageContext.Get("Dynamic.Message")
I hope this will help you
Upvotes: 0