Answers for "c# @ string variable"

C#
5

c# write variable in string

int age = 22;

Console.WriteLine($"Age: {age}");
Posted by: Guest on July-03-2020
2

c# $ string

string color = blue;

// Both versions do the same thing.
Console.WriteLine("The sky is " + color);
Console.WriteLine($"The sky is {color}");
//Note the dollar ^sign    and ^curly^ brackets.
Posted by: Guest on March-27-2021

C# Answers by Framework

Browse Popular Code Answers by Language