This method is used to return the specified contents of a string. To return the complete string, pass 0, -1 as the parameters.