roslyn
roslyn copied to clipboard
Offer to to introduce variable in string
Before:
Console.WriteLine("Hello Your Name");
After (applied refactoring to selection "Your Name"):
var name = "Your Name";
Console.WriteLine($"Hello {name}");
Should the refactoring encourage interpolation in that case or the simpler (and more efficient) concatenation? Or provide the option to do either?
Perhaps:
var name = "Your Name";
Console.WriteLine("Hello {0}", name);
we would take a small community fix here.,
Not planning on doing this.