Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
String interpolations in C#
var userName = "ChrisMissal";
var someString = "Hello, my name is $(userName), nice to meet you!";
var a = "Now is $(DateTime.Now).";
var b = "Tomorrow will be $(DateTime.Now.AddDays(1))";
var c = "This list has $(list.Count()) items.";

They should use the Razor syntax for this...

var a = "Now is @{DateTime.Now}.";


ChrisMissal commented Jun 4, 2012

Yeah, I can get on board with that. I'm fine with whatever syntax, I just feel that something needs to be implemented. I believe the syntax I posted is how Boo does it.

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