Write program to calculate the length of a string
You can use the Length property from string class.
using System; public class MainClass{ public static void Main(String[] argv){ Console.WriteLine("Enter a string"); string inputString = Console.ReadLine(); Console.WriteLine("Length of the string \"{0}\" is {1}", inputString, inputString.Length); }//from w w w . j a v a2 s .c o m }