Using string's Length Member : String Length « String « C# / CSharp Tutorial






class MainClass
{
  static void Main()
  {
      string palindrome;

      System.Console.Write("Enter a palindrome: ");
      palindrome = System.Console.ReadLine();

      System.Console.WriteLine("The palindrome, \"{0}\" is {1} characters.",palindrome, palindrome.Length);
  }
}








5.7.String Length
5.7.1.Get string length and output string
5.7.2.Using string's Length Member