I have to replace expression below:-
public string Body =>
this._body;
To:
public string Body
{
get{return _body;}
set{_body = value;}
}
I am using Notepad++ to find and replace as below:-
Find regx: =>\s*.*?;
Replace regx: {get{return\s*.*?;} set{\s*.*? = value;}}
which seems not working and replace it incorrectly without property name as below:-
Public string Body {get{returns*.*?;} set{s*.*? = value;}}
How can we change the expression to get the desired result with property name?
Also can we do something like this in Visual Studio
? Thank you.
Here is a way to do the job with Npp:
\b(public\s+string\s+Body)\s+=>\s+this\.(\w+);
$1 {get{returns $2;} set{$2 = value;}}