Formatting
To format a string is simple, you just need to prefix your "string"
with a $
. Like this: $"string"
. Then you can use curly braces {}
to insert as many expressions into your string as you would like.
Let us take a simple example for inserting a variable into a string.
Any expression is allowed when formatting a string, like adding values, calling functions or even if expressions.
Last updated