Looking to get a head start on your next software interview? Pickup a copy of the best book to prepare: Cracking The Coding Interview!
var str = "Hello World";
console.log(str.length); // outputs 11
However, in C#, finding the length of a string requires calling the
string str = "Hello World";
Console.WriteLine(str.Length); // outputs 11
It’s important to note that in C#, the
Length property is a property of the
length property is a property of the
Overall, while finding the length of a string may seem like a small task, it’s important to understand the differences in implementation between programming languages.