In Ruby, I can put multiple statements in a interpolated string, eg.
puts "#{a = 1; b = 2; a + b;}"
Or I can put them in multiple lines like this:
puts "#{a = 1;
b = 2;
a + b;}"
Can I do the same thing in C# 6? I've tried but failed. Below is my C# code.
Console.WriteLine($@"haha
{int a = 1;
int b = 2;
a+b;}
heihei");
When I try to run the C# program, I got:
CS1525 Invalid expression term 'int'
CS1073 Unexpected token 'a'
I hope someone can help.