Skip to content

Instantly share code, notes, and snippets.

@richlander
Created October 12, 2021 15:33
Show Gist options
  • Save richlander/42ea9d699a70ec9a1b60232ceea6734b to your computer and use it in GitHub Desktop.
Save richlander/42ea9d699a70ec9a1b60232ceea6734b to your computer and use it in GitHub Desktop.
const interpolated string example
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Console" Static="True"/>
</ItemGroup>
</Project>
const string Bar = "Bar";
const string DoubleBar = $"{Bar}_{Bar}";
WriteLine(DoubleBar);
@richlander
Copy link
Author

Produces the following output:

Bar_Bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment