Amazing substring behaviour
In a recent code review at my workplace I found a piece of C# code that contained something along this line:
string foo = "bar";
string substring = foo.Substring(3);
Clearly index position 3 is beyond the end of the string, so I thought I had found a bug and was about to flag the code. Then it occurred to me: Why had the unit tests not failed during the gated checkin build?