Created
January 25, 2017 20:06
-
-
Save binki/eadb3986c19dfea1e6369f698b60b212 to your computer and use it in GitHub Desktop.
Haxe Interpolated String Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
intr($"asdf{""}{"bsdf"}"); // Format=asdf{0}{1}, Arguments=“”,“bsdf” | |
intr($"asdf{""}bsdf"); // Format=asdf{0}bsdf, Arguments=“” | |
} | |
static void intr(FormattableString s) | |
{ | |
Console.WriteLine($"Format={s.Format}, Arguments={string.Join(",", s.GetArguments().Select(a => $"“{a}”"))}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment