Use interpolated strings 1 by CarloToso · Pull Request #18967 · PowerShell/PowerShell · GitHub
Skip to content

Use interpolated strings 1#18967

Closed
CarloToso wants to merge 7 commits intoPowerShell:masterfrom
CarloToso:Use-interpolated-strings
Closed

Use interpolated strings 1#18967
CarloToso wants to merge 7 commits intoPowerShell:masterfrom
CarloToso:Use-interpolated-strings

Conversation

@CarloToso
Copy link
Copy Markdown
Contributor

@CarloToso CarloToso commented Jan 18, 2023

PR Summary

Where possible use interpolated strings

PR Context

Proposed by @iSazonov.
174 more files contain {0}, I'll continue after this PR is merged

PR Checklist

@pull-request-quantifier-deprecated
Copy link
Copy Markdown

@iSazonov
Copy link
Copy Markdown
Collaborator

iSazonov commented Jan 18, 2023

@CarloToso Perhaps I was inaccurate. I meant using new APIs which use interpolated string handler - it reduces allocations and makes code faster - String.Format(), StringBuilder.AppendFormat(), String.Create(). https://devblogs.microsoft.com/dotnet/string-interpolation-in-c-10-and-net-6/
All other callsites do not make sense to change. There we should change/improve APIs themselves. This is not always easy. For example, #18246.

.NET Blog
Learn about String Interpolation in C# 10 and .NET 6

@CarloToso
Copy link
Copy Markdown
Contributor Author

@CarloToso CarloToso closed this Jan 18, 2023
@CarloToso CarloToso deleted the Use-interpolated-strings branch January 18, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants