From: Trans Date: 2006-09-03T02:10:39+09:00 Subject: Ordered contrast for String or Array I have two strings: "aabc" and "aacd". I want to get an "ordered contrast" to see the difference in their spellings. Eg. "aabc".ordered_contrast( "aacc" ) => " cc" In the example a space represents a matching string, although I suppose there may be a better alternative. In any case, one could also imagine a non-ordered contrast: "aabc".contrast( "aacc" ) => " c " And conversly one could ask for the intersect. "aabc".inersect( "aacc" ) => "aa c" "aabc".ordered_inersect( "aacc" ) => "aa " These could be extended to Array as well, and String could just use split(//) with those. So the question is: Is there an efficient way to calculate these? Thanks, T.