I have a QT Project where I get the full name as a QString variable fullName
from user input. I'd like to store the first name (firstName
) and last name (surname
) in their own QString variables by extracting them from fullName
.
The user input could end up adding their middle names as well so I need to to work for all kind of examples like that, eg. user input: Barry Michael Doyle
would have to give firstName
the value of Barry
and surname
the value of Doyle
.
I'm not very good at QString Manipulation as I've only recently started using the Qt Library. I'd appreciate all the help I could get.