require 'pry' class String def sentence? self.end_with?(".") end def count_sentences self.split(/\.|\?|\!/).delete_if {|w| w.size < 2}.size end end
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter