CSharp examples for Language Basics:string
Storing text in String variable
using System;/*w w w . j a va 2 s . c om*/ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { // Declaration of a variable to store text string message; // Storing a value in prepared variable (assignment statement) message = "I can't live with you."; // Another variable (initialized with some value) string anotherMessage = "I can't live without you."; // Output of variables Console.WriteLine(message); Console.WriteLine(anotherMessage); } }