Gets the number of characters in the current instance.
A int containing the number of characters in the current instance.
The following example demonstrates the string.Length property.
C# Example
using System;
public class StringLengthExample {
public static void Main() {
string str = "STRING";
Console.WriteLine( "The length of string {0} is {1}", str, str.Length );
}
}
The output is
The length of string STRING is 6