Introduction
Strings let us store and use words or sentences in our programs. Literal types help us write these words directly in the code.
Jump into concepts and practice - no test required
string variableName = "your text here"; string verbatimString = @"your text here";
string greeting = "Hello, world!";string path = @"C:\Users\Name\Documents";string multiline = @"Line 1
Line 2
Line 3";string quote = "She said, \"Hello!\"";using System; class Program { static void Main() { string normal = "Hello, friend!"; string verbatim = @"This is a verbatim string It keeps new lines and ""quotes""."; Console.WriteLine(normal); Console.WriteLine(verbatim); } }
string s = "Line1\nLine2"; Console.WriteLine(s);
string s = @"Hello\nWorld";
C:\Users\Admin\Documents