Problems with IDE and C#

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 forLenght’ and no extension method Lenght' of typestring’

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.

Try with “Length” instead of “Lenght”.

1 Like

I’m not sure there’s a problem here. Can you explain how we can reproduce? Also, if you write the word “Lenght” in a comment, the completion system will suggest it.