Mono Class Library: System.String Overview | MembersSystem.String.Length Property |
Gets the number of characters in the current instance. [Edit]
|
A int containing the number of characters in the current instance. [Edit]
This property is read-only. [Edit]
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
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0