From: Daniel N Date: 2007-03-28T08:47:26+09:00 Subject: String Intersection. A better way ------=_Part_4392_13800102.1175039245036 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I have an issue with strings. I want the intesection of two strings but I'm not sure how to go about it. I have two cases. Case 1: String 1 has the tail end intersecting with the start of string 2.. eg: String 1: The quick brown fox jumped over the lazy dog. String 2: fox jumped over the lazy dog. And in other news bla bla bla The problem is I don't know how much is intersecting. What I've done is to take string 1 and say psudo code until match found string2 =~ /^(value of string1)/ if match found set flag else delete first char of string1 loop again What is a better way to do this? Case 2: The start of String1 intersects with the end of string2 eg: String1: And here we are with another string. String2: bla bla bla. And here we are I don't really know about this one yet... I haven't gotten to it. Can anyone pls suggest what I might do? Thanx Daniel ------=_Part_4392_13800102.1175039245036--