dotnet/roslyn
Auf GitHub ansehen"Convert to interpolated string" refactoring could simplify constant arguments
Open
#77.023 geöffnet am 4. Feb. 2025
Area-IDEhelp wanted
Repository-Metriken
- Stars
- (20.414 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)
Beschreibung
Repro:
string s = string.Format("{0}={1}", "Key", null);
Run "Convert to interpolated string" on this. It produces:
string s = $"{"Key"}={null}";
but it could have produced:
string s = $"Key=";
or since there are no other holes in this particular case:
string s = "Key=";