Not able to find 'getPrefix' function

Not able to find 'getPrefix' function

Hi, I'm just trying to get a first name from a full name in CRM, but when I save the function, there's an error.
My function is:
  1. full = input.fullname;
  2. full.getPrefix(" ");
  3. input.firstname = full;
I'm on API V1, do I need V2?
Can I achieve this any other way? (the format is (firstname + " " + lastname) and the length of the string varies)

Thanks in advance.