how do i break down a string?
Posted on 2004-10-18
i am given name strings from a xml feed similar to as follows:
Mr. Joe Smith
Mrs. Jane Doe
i need to break the string down into 3 strings: first name, last name, and title. the last name will always be leftmost characters ending at the first space (this may be wrong sometimes if they have a last name with 2 words (i.e. von houghton), but thats ok). the first name will be characters from the first space in front of the last name to the beggining of the string or the '.' period if there is one. if there is a period, the characters preceding it will be the title, if no period i can assume there is no title. any ideas on how i can do this?