Get string length and output string : String Length « String « C# / CSharp Tutorial






using System;  
  
class MainClass {   
  public static void Main() {   
    string str1 = "ABCDEabcde1234567890";   
  
    Console.WriteLine("str1: " + str1); 
 
    Console.WriteLine("Length of str1: " + str1.Length);   
  }
}
str1: ABCDEabcde1234567890
Length of str1: 20








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