Results 1 to 6 of 6
  1. #1
    Cylab is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default compare the remaining of Strings for equality

    E.g. <kind>moon</kind>
    If one string starts with < (and not </) and the other starts with </, is there any way of comparing the remaining for equality.

    As an idea, I want to push the string starting with < into stack, when / is encountered pop off from stack.

    Thanks.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,663
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Cylab View Post
    E.g. <kind>moon</kind>
    If one string starts with < (and not </) and the other starts with </, is there any way of comparing the remaining for equality.

    As an idea, I want to push the string starting with < into stack, when / is encountered pop off from stack.

    Thanks.
    Use a proper XML parser; all the other ways (including regular expressions) are just hacks.

    kind regards,

    Jos

  3. #3
    Cylab is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Why there is no direct answer to the questions in the Forum. BELIEVE IN REASON OF OTHERS!

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,663
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Cylab View Post
    Why there is no direct answer to the questions in the Forum. BELIEVE IN REASON OF OTHERS!
    huh?

    Jos

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Cylab View Post
    Why there is no direct answer to the questions in the Forum.
    You have been given a correct answer above.


    BELIEVE IN REASON OF OTHERS!
    This makes no sense whatsover.


    Again, do not multipost the same question in multiple threads as this is against forum rules since it unnecessarily fragments discussion of an issue. I have locked the other thread.

    Edit: indeed, you've been warned against this before. If you continue to disregard this, you may be banned.
    Last edited by Fubarable; 08-19-2010 at 03:45 PM.

Similar Threads

  1. Compare between 2 Strings
    By ChaosINC in forum New To Java
    Replies: 3
    Last Post: 01-17-2010, 12:39 PM
  2. Replies: 15
    Last Post: 11-06-2009, 11:31 AM
  3. [SOLVED] Cant compare strings sent by client
    By christuart in forum Networking
    Replies: 15
    Last Post: 09-01-2008, 04:24 AM
  4. JSTL -- Comparing two strings for equality
    By trinkets in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-12-2008, 05:39 PM
  5. how to compare two strings
    By elizabeth in forum New To Java
    Replies: 7
    Last Post: 08-06-2007, 04:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •