Keith Rozario

46%
Flag icon
As a final example, consider the Java String class and its substring method. Given two indexes into a string, substring returns the substring starting at the character given by the first index and ending with the character just before the second index. However, if either index is outside the range of the string, then substring throws IndexOutOfBoundsException. This exception is unnecessary and complicates the use of this method. I often find myself in a situation where one or both of the indices may be outside the range of the string, and I would like to extract all of the characters in the ...more
This highlight has been truncated due to consecutive passage length restrictions.
Keith Rozario
Simpller software
A Philosophy of Software Design
Rate this book
Clear rating
Open Preview