KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I don't know if this is actually good ruby code, but what I am trying to do is split a String into two separate sections and put the two as values to two specific keys. For example: name_a = "Henry Fillenger".split(/\s+/,2) name = {:first_name => name_a[0], :last_name => name_a[1]} I was wondering if this could be done in a single line through some ruby magic however.
Tags (comma-separated)
Save Edits
Cancel