The substring begins with the character at the startIndex and extends to the character at index endIndex - 1.
Parameters startIndex : starting index is inclusive endIndex : ending index is exclusive Returns specified string Exception Throws StringIndexOutOfBoundsException is thrown when any one of the following conditions is met.