EN
C# / .NET - how to check string length?
0 points
In C# it is possible to check string length in the following way.
xxxxxxxxxx
1
using System;
2
3
public class Program
4
{
5
public static void Main(string[] args)
6
{
7
string text = "This is my text...";
8
string anotherText = "Another text...";
9
10
Console.WriteLine( text.Length ); // 18
11
Console.WriteLine( anotherText.Length ); // 15
12
}
13
}
Output:
xxxxxxxxxx
1
18
2
15