🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Burak Kemal KOYUNCU / C# / String.Length kullanımı

1-) C# - String.Length kullanımı

 

Geçerli nesnedeki karakter sayısını alır String .

 

string str = "abcdefg";

Console.WriteLine("1) The length of '{0}' is {1}", str, str.Length);

Console.WriteLine("2) The length of '{0}' is {1}", "xyz", "xyz".Length);

int length = str.Length; Console.WriteLine("3) The length of '{0}' is {1}", str, length);

 // This example displays the following output: //

1) The length of 'abcdefg' is 7 //

2) The length of 'xyz' is 3 //

3) The length of 'abcdefg' is 7

 2021 Ocak 21 Perşembe
 346