C# – How to use format strings with string interpolation

Interpolated strings have the following structure: {variable:format}. Typically you exclude the format, so they normally look like this: $”My name is {name}”. Here’s how to use format strings with an interpolated string: This outputs the following: This is the equivalent of using string.Format() like this: Read more about why you should use string interpolation instead … Read more