Bookmark Topic Watch Topic
  • New Topic

Best way to figure out overlapping of strings  RSS feed

 
Binu K Idicula
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I have 2 Strings. Is there a regex way of finding out the overlapping part?


String str1 = "AB-CD";
String str2 = "CH-EF"

Now C is the overlapping part. I did it with tokenizer and with a custom algorithm, going one by one. But Is there a simple way out?

<I just asked the same question in Java Advanced Topics in Java Ranch, without realizing that this is the right forum>

regards
Binu K Idicula
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Binu K Idicula:

<I just asked the same question in Java Advanced Topics in Java Ranch, without realizing that this is the right forum>


You can delete your previous post by clicking on the edit icon and checking the box that's labled "delete this post".
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Report post to moderator
Binu:
<I just asked the same question in Java Advanced Topics in Java Ranch, without realizing that this is the right forum>


I am not sure whether this is the correct forum too.
I have moved your Java -Advanced post to Programming Diversions forum. I thought it better suits there as the question is more about finding the best algo and not something specific to Java.
[ December 02, 2008: Message edited by: Nitesh Kant ]
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!