CSharp - Write program to calculate the length of a string

Requirements

Write program to calculate the length of a string

Hint

You can use the Length property from string class.

Demo

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 . java  2s  .c o  m*/
}

Result