Changed Implementation of replace,indexOf is returning proper error messages(instead of -1) if invalid index is given as input,changed Substring implementation