Skip to content

Instantly share code, notes, and snippets.

@douglashill
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglashill/0c5f51d72701c2bafaa3 to your computer and use it in GitHub Desktop.
Save douglashill/0c5f51d72701c2bafaa3 to your computer and use it in GitHub Desktop.
input = "NSHandlesContentAsCompoundValueBindingOption"
list = input.split /(?=[A-Z][a-z])/
if list.first.upcase == list.first
list.shift
end
puts list.map {|item| item.downcase}.join " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment