dotnet/roslyn

Use interpolated strings instead of String.Concat or String.Join

オープン

#58,557 opened on 2022/01/03

 (15 件のコメント) (0 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEhelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Brief description:

I've gotten some legacy code which is rewritten about 10 years ago where a lot of String.Concat(string[]) or String.Join(string, params string[]) are used. Can you provide a code refactoring to change them to interpolated strings?

Languages applicable:

C# (maybe VB.NET also)

Code example that the analyzer should report:

String.Concat("Hello ", user.Name, "! Time is ", DateTime.Now.ToString());
logger.Log(String.Join(" ", DateTime.Now.ToString(), LogLevel.Info.ToString(), logCategory, logContent));

コントリビューターガイド