String Concatenation
Combining multiple strings together into a new string value.
Syntax:
Combining Literal String (s) or string Variable (s) together using +
String Interpolation
Instead of using +
use it inside a doubles quotes under a template and using one or more Interpolation Expression.
Basically a literal string but becomes a template when the $
character is used before the " "
. The Dollar Symbol makes anything inside the { curly braces} a live C# variable or expression. Similar to Python’s version of print({}.format(first name)
We can also combined Verbatim Literal String using the @
key with String Interpolation. The follar symbol just makes anything inside the {curly braces} versatile C# function.
Syntax Highlighting makes it easier to understand what would get printed out “literally” and what is a dynamic component in a line.
You save some extra keystrokes when using String Interpolation