added a substring method for String