Method: Rex::Text.refine

Defined in:
lib/rex/text.rb

.refine(str1, str2) ⇒ Object

Removes noise from 2 Strings and return a refined String version.



462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/rex/text.rb', line 462

def self.refine( str1, str2 )
  return str1 if str1 == str2

  # get the words of the first str in an array
  s_words = to_words( str1 )

  # get the words of the second str in an array
  o_words = to_words( str2 )

  # get what hasn't changed (the rdiff, so to speak) as a string
  (s_words - (s_words - o_words)).join
end