Skip to content

Instantly share code, notes, and snippets.

@akarpov89
akarpov89 / InterpolatedParsing.cs
Created October 1, 2021 14:58
Interpolated parsing technique
using System.Runtime.CompilerServices;
using static ParsingExtensions;
string input = "Name: Andrew; Age: 31";
string? name = null;
int age = 0;
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}"))
{