Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: help to find common String not simple !!

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question help to find common String not simple !!

    hi
    i need to find common String between to Strings :
    Example 1:
    Customer Name 1: Dr. Joe Smith
    Customer Name 2: Joseph Smith, MD.
    I need to search the string for a match, in this example “Smith”

    Example 2:
    Customer Name1: New York Market Place
    Customer Name 2: NY Marketplace
    I need to search the string for a match, in this example “Market place”

    Example 3:
    Customer Name1: The Deli on the Corner
    Customer Name 2: Corner Deli
    I need to search the string for a match, in this example “Deli Corner”


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: help to find common String not simple !!

    What have you tried?

    What are the rules for examples 2 and 3? The search looks a lot more complicated there.

    Be sure to wrap your code with code tags:
    [code=java]
    YOUR CODE GOES HERE
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: help to find common String not simple !!

    hi
    i still did not write any code, as example 2 and 3 seems to be complicated.

    its task i got and i need to do it, if there is any idea to start.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: help to find common String not simple !!

    First look at what tools may be useful: The String class's methods and some collection class like Map or Set to hold parts of the String as the search is made.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Traverse through the one String and find it contains the other String
    By entwicklerin in forum Loops & Control Statements
    Replies: 9
    Last Post: January 17th, 2012, 01:42 PM
  2. [SOLVED] How to find if a sting contains another string?
    By deathpk in forum Java Theory & Questions
    Replies: 2
    Last Post: October 16th, 2011, 07:14 PM
  3. How to find a a certain part in string
    By redzero36 in forum Java Theory & Questions
    Replies: 7
    Last Post: July 19th, 2011, 06:39 PM
  4. Has to be a simple error, but I can't find it.
    By fride360 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 22nd, 2011, 10:15 AM
  5. Replies: 2
    Last Post: November 3rd, 2009, 06:28 AM