Results 1 to 6 of 6
  1. #1
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default Comparison with " and '

    How i can compare char values that contain chars named in the TITLE..I use this for compare any value:
    if (str.charAt(h)==':'){
    start=h;
    }
    if (str.charAt(h)=='='){
    start=h;
    }
    }

    But it does not work with that values..The message-error occure.

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

    Default

    Quote Originally Posted by cowboy View Post
    How i can compare char values that contain chars named in the TITLE..I use this for compare any value:
    if (str.charAt(h)==':'){
    start=h;
    }
    if (str.charAt(h)=='='){
    start=h;
    }
    }

    But it does not work with that values..The message-error occure.
    What error message?

    kind regards,

    Jos

  3. #3
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default

    IT is impossible in Java to write thing like this

    if (str.charAt(h)=="""){
    start=h;
    }

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

    Default

    Quote Originally Posted by cowboy View Post
    IT is impossible in Java to write thing like this
    A character is a character and a String is a String; they're different types. A single double quote character is written as '\"' and a single single quote character is written as '\''. Consequently a single double quote String is written as "\"" and a single single quote String is written as "\'".

    kind regards,

    Jos

  5. #5
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default

    Thank! It is work! How i can increase your reputation at forum?

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

    Default

    Quote Originally Posted by cowboy View Post
    Thank! It is work! How i can increase your reputation at forum?
    I don't know but ample supplies of Jenever and tobacco are also received in great gratitude ;-)

    kind regards,

    Jos

Similar Threads

  1. Replies: 1
    Last Post: 01-21-2010, 09:20 AM
  2. problem with argument list and precedence "(" and ")"
    By helpisontheway in forum Advanced Java
    Replies: 6
    Last Post: 12-24-2009, 07:50 AM
  3. Replies: 2
    Last Post: 10-08-2009, 11:28 PM
  4. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 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
  •