Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Usage: "john.doe@example.com".guess_name_from_email
- class String
- def guess_name_from_email
- self.split('@')[0].split('.').instance_exec { [ shift, pop ] }.compact.map { |n| n.capitalize }.join(' ')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement