A friend of mine came to me with this strange behavior which i can\'t explain, any insight view would be appreciated.
Im running VS 2005 (C# 2.0), the following code
Just for the fun of it. It also works like that in python
>>> "test".startswith("") True >>> "test".index("") 0
Python throws a ValueError instead of the -1 that is nice.
>>> "test".index('r') Traceback (most recent call last): File "", line 1, in ValueError: substring not found