Remove if Follow
Hi,
is it possible to remove an if-surround.
Example:
I have following if block:
if(a == b)
{
DoSomething();
}
Now I want to remove the if-surround by remaining the inner block by a magic shortcut. So the result should be:
DoSometing();
Is this possible by a standard feature or by a kind of template.
Markus
Please sign in to leave a comment.
Hi,
You could try to use Search and Replace with pattern. R# -> Tools -> Pattern Catalog. Let me know if it helps you.
--
Kirill Falk
.NET Team QA Lead
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Ok, I tried following replace pattern:

![]()
... and it works!
Example:
This:
if (wizard != null && filePath.Length > 1)
{
//aa
Console.WriteLine("test");
Console.WriteLine("test2");
}
becomes to:
Console.WriteLine("test");
Console.WriteLine("test2");
Oh my comment (//aa) is removed. So my pattern is not yet perfect...
Markus