# File lib/facet/string/first%3D.rb, line 13 def first=(str, separator=$/) separator = /\n+/ if separator == '' separator = /\s+/ unless separator separator = Regexp.new( Regexp.escape( separator ) ) if String === separator i = self.index(separator) return nil unless i self[0...i] = str end