Skip to content

Instantly share code, notes, and snippets.

@hpjaj
Created December 7, 2014 18:26
Show Gist options
  • Save hpjaj/e74c97eb534a8df4e040 to your computer and use it in GitHub Desktop.
Save hpjaj/e74c97eb534a8df4e040 to your computer and use it in GitHub Desktop.
Week 3 - 5e - Key = Value
s = 'key=value'
# arr = s.split("=")
s1, s2 = s.split("=")[0], s.split("=")[1]
#s1, s2 = arr[0], arr[1]
puts s1 #=> key
puts s2 #=> value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment