Limit Split
"this string has many spaces".split(" ")
# => ["this", "string", "has", "many", "spaces"]
"this string has many spaces".split(" ", 3)
# => ["this", "string", "has many spaces"]"Josh Branchaud".split(" ", 2)
# => ["Josh", "Branchaud"]
"David Heinemeier Hansson".split(" ", 2)
# => ["David", "Heinemeier Hansson"]def create_user(name)
user = User.new
user.first_name, user.last_name = name.split(" ", 2)
user.save
endLast updated