module Stringex::StringExtensions::PublicInstanceMethods

def limit(limit = nil, truncate_words = true, whitespace_replacement_token = "-")

Returns the string limited in size to the value of limit.
def limit(limit = nil, truncate_words = true, whitespace_replacement_token = "-")
  if limit.nil?
    self
  else
    truncate_words == false ? self.whole_word_limit(limit, whitespace_replacement_token) : self[0...limit]
  end
end