string management

I want to prompt for a full name, then select the surname from the full name.
Then address the person as the surname entered in the fullname

Sounds like a homework assignment.