Google Interview Question

Code a method to split a string into an array based on spaces