Substring in C# (and Java) throw an exception if you take a substring and give it a length (or a starting position) that puts you after the end of the string. That's basically to ensure that you always get a string that's exactly the length you want? Rather than just being able to take a substring and not having to worry about it, you have to include code like the following around every single substring you ever take:
if (str.Length > 30){
str = str.Substring(0, 30);
}
Typically when you take a substring you want to ensure that your string is no longer than a certain number of characters. I can't think of a situation that would it a good idea for the language to enforce that you can't get a string that's less than the maximum length you want instead of exactly the length you want.
On the other hand, most of the dynamic languages (PPPR) let you substring off the end of the string without worrying about it.
getElementsByClass function
http://pitfalls.wordpress.com/2008/07/07/querying-it-jquery-way-getelements...
maxgandalf: Jul 7, 5:50am