How to copy the dynamic text from sap

HI I have to copy the name from sap.
It has first name and last name. If the name is like; chirag singh then I can copy it on the basis of space.
If I have name like; chirag singh chauhan. Then how to fetch the last name?
Any leads will be appreciate? Please help

Hi @Chirag1991,
Maybe this topic will help:

Let me know if this solves your problem.