lib/core/facets/string/shatter.rb in facets-2.4.5 vs lib/core/facets/string/shatter.rb in facets-2.5.0

- old
+ new

@@ -8,10 +8,10 @@ # # _produces_ # # ["<p>", "This", "<b>", "is", "</b>", "a test.", "</p>"] # - # CREDIT: Trans + # CREDIT: Trans def shatter( re ) r = self.gsub( re ){ |s| "\1" + s + "\1" } while r[0,1] == "\1" ; r[0] = '' ; end while r[-1,1] == "\1" ; r[-1] = '' ; end