The substring method of the String class might be able to help you with part of that.