This pull request introduces a new Roslyn analyzer and associated code fix provider to enforce best practices for culture-specific string formatting in C#. The analyzer identifies cases where FormattableString or string.Create should be used instead of string for interpolated strings, depending on the target framework version. The code fix provider automatically suggests the appropriate replacement.
This pull request introduces a new Roslyn analyzer and associated code fix provider to enforce best practices for culture-specific string formatting in C#. The analyzer identifies cases where
FormattableString
orstring.Create
should be used instead of string for interpolated strings, depending on the target framework version. The code fix provider automatically suggests the appropriate replacement.Changes
FormattableStringForCultureSpecificStringsAnalyzer
FormattableString
,string.Create
, orstring.Format
based on the .NET version.FormattableStringForCultureSpecificStringsCodeFixProvider
This analyzer aligns modern C# and .NET practices, particularly Stephen Toub's guidance on using
string.Create
in .NET 6+