Last active
April 15, 2016 19:09
-
-
Save nickhoffman/73dfdc3574906cbcd5f89376d2499963 to your computer and use it in GitHub Desktop.
Code Kata: string splitter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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