Skip to content

Instantly share code, notes, and snippets.

@nickhoffman
Last active April 15, 2016 19:09
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 nickhoffman/73dfdc3574906cbcd5f89376d2499963 to your computer and use it in GitHub Desktop.
Save nickhoffman/73dfdc3574906cbcd5f89376d2499963 to your computer and use it in GitHub Desktop.
Code Kata: string splitter
class String
def multiline_split(max_line_length)
self
end
end
puts "foo\nbar\nbaz" == "foo bar baz".multiline_split(3)
puts "foo bar\nbaz" == "foo bar baz".multiline_split(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment