For instance this compiles in Visual Studio 2015 but fails on Coding Monkey:
public class StringManipulation
{
public string GetFirstLetter(string input)
{
return input.SubString(0, 1);
}
}
with this error:CS1061 5 'string' does not contain a definition for 'SubString' and no extension method 'SubString' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
What's going on? MSDN says that string is an alias for System.String which definitely has SubString().
I don't use C# very much but I do use .Net very heavily so I am very interested to know why that code doesn't work on Coding Monkey. Perhaps it will improve my code.
Edit: I do realize that explaining why something is wrong is a seriously difficult task, but eventually the same wrong answers will appear repeatedly so a canned response should be possible in the end, at least for some code.