You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'IDE0071: Simplify interpolation' is not suggested for Span<T> or ReadOnlySpan<T> for .NET 6+.
String interpolation was significantly improved in .NET 6+ with the introduction of interpolated string handlers. For projects targeting .NET6+ code like this should trigger IDE0071:
varspan="abc".AsSpan();vars=$"{span.ToString()}";// Should trigger IDE0071
In older .NET versions including .NET Framework interpolated string expressions are lowered to string.Format calls, so IDE0071 should not be reported for projects targeting older .NET versions:
varspan="abc".AsSpan();vars=$"{span.ToString()}";// Should not trigger IDE0071, removing ToString will cause 'ReadOnlySpan<char> cannot be converted to object'