I’m not sure what is the problem, maybe it is in my side, but, the string.Lenght is not working the error message:
error CS1061: Type string' does not contain a definition for
Lenght’ and no extension method Lenght' of type
string’
example of what should be happening but is not:
using System;
class Sample
{
public static void Main()
{
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
I tried in monodevelop and it’s all ok but codingame, this error shows up with IDE upgrade, if someone can give me a solution or explain me why is this happening I will be totally grateful.