CSharp examples for Language Basics:string
Work on Texts via string object
using System;/*from ww w.ja va 2s .c om*/ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { // Some text to try things on string text = "This is the last day of our acquaintance"; // What e.g. can be done with texts Console.WriteLine("Original text: " + text); Console.WriteLine("Number of characters: " + text.Length); Console.WriteLine("In uppercase: " + text.ToUpper()); Console.WriteLine("Does it contain word \"last\"? " + text.Contains("last")); } }