I have started to use Interpolated Strings (new feature of C# 6) and it is really useful and gracefully. But according to my needs I have to pass format of string to a metho
There are several ways you can do this.
The first one is to add another method overload that takes a FormattableString
(a new typed used by one of the variants of string interpollation) and calls the original one:
public void MyMethod(FormattableString fs)
{
MyMethod(fs.Format);
}
And you also have access to the arguments if you need to.
If you only need the format, just create an extension method to extract it:
public static string AsFormat(FormattableString fs)
{
return fs.Format;
}