This is harder than it may appear.. What happens if someone has last name 'van der Water'? What you're trying to do is usually done the other way around: compose the full name by adding firstname and last name together.
Capturing First name and Last name separately and then using a Before Commit event handler to create the full name string would make your life so much easier. With that said, you could accomplish this in java. It would be a custom java action that takes in two string parameters ( One for the full name, and a second one for a regular expression for a space), and then would return a list (the first and last name). But as Luc said, this will be harder than it appears, so if you do have the option to capture first and last name separately, I recommend doing that.