In this example, you will learn to compute the length (size) of a string.
C# Code:
1 2 3 4 5 6 7 8 9 | static void Main(string[] args) { string str = "C# Examples"; Console.WriteLine("String Length : "+str.Length); Console.ReadKey(); } |
Output:
1 2 3 | String Length : 11 |