module Stringex::StringExtensions::PublicInstanceMethods
def collapse(character = " ")
String#squeeze(character), condensing runs of the character within the string.
Removes specified character from the beginning and/or end of the string and then performs
def collapse(character = " ") sub(/^#{character}*/, "").sub(/#{character}*$/, "").squeeze(character) end