Create a class with the following:
- Attribute InterpolatedStringHandler applied to the class
- Constructor with parameters
int literalLength and int formatCount
- Public methods AppendLiteral and AppendFormatted:
public void AppendLiteral(string s)
public void AppendFormatted<T>(T t)
Notes:
- AppendFormatted may have additional parameters
int alignment and string format:
- e.g. when using
$"{value,-15:red}"
- The methods may return bool to stop interpolation at any point.
Know more:
References: