splits and counts sentences even if there is punctuation like "!!!" and "....."

PHOTO EMBED

Thu Dec 03 2020 20:21:58 GMT+0000 (Coordinated Universal Time)

Saved by @theo #ruby

require 'pry'

class String

  def sentence?
    self.end_with?(".")
  end

  def count_sentences
    self.split(/\.|\?|\!/).delete_if {|w| w.size < 2}.size
  end
end
content_copyCOPY

https://github.com/learn-co-students/ruby-oo-self-count-sentences-lab-dumbo-web-010620/blob/solution/lib/count_sentences.rb