Languages
[Edit]
EN

C# / .NET - how to check string length?

0 points
Created by:
Dirask Admin - Marwin
1430

In C# it is possible to check string length in the following way.

String Length property example

using System;

public class Program
{
    public static void Main(string[] args)
    {
        string text = "This is my text...";
        string anotherText = "Another text...";

        Console.WriteLine( text.Length );        // 18
        Console.WriteLine( anotherText.Length ); // 15 
    }
}

Output:

18
15

C# / .NET - String (popular problems)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join