Extract first and last name

Extract first and last name

I am trying to build a custom function in Flow, when a new Zoho Booking is added I want to split the Name field into first last name. 

I understand the function needs to be a string and this works but I am unsure how to write this in the flow script. 

result = first_name.getPrefix(" ");
info result;

I also assume to then create the last name Ill use the same but getSufix 

Any help greatly appreciated. 


:-)