class String
def split_thingie(words = 10)
self.split(" ")[0..words-1]
end
end
puts "hello there. This is just a test of the split thingie. It should work".split_thingie.inspect
# => ["hello", "there.", "This", "is", "just", "a", "test", "of", "the", "split"]
|
Pastie
