Results 1 to 2 of 2
  1. #1
    smritigarg is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default Set not working '-' as unique string

    Hi Friends ,

    Few Days before I faced an issue , I used Set to store only unique strings for one of my requirements but the strange thing was Set was allowing me to store "-" twice . As in it was not considering the hyphen as unique string , I could not find any apt explanation for this behavior , please help me with proper explanations that how could this happen

    Kind Regards,
    Smriti Garg

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

    Default

    Quote Originally Posted by smritigarg View Post
    Hi Friends ,

    Few Days before I faced an issue , I used Set to store only unique strings for one of my requirements but the strange thing was Set was allowing me to store "-" twice . As in it was not considering the hyphen as unique string , I could not find any apt explanation for this behavior , please help me with proper explanations that how could this happen
    Print out the Unicode of those two single char Strings. I bet they are different.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. How to set the unique color for windows and Mac os
    By prasad.vara in forum AWT / Swing
    Replies: 0
    Last Post: 12-03-2010, 10:55 AM
  2. Encrypting unique columns
    By andy16 in forum JDBC
    Replies: 0
    Last Post: 05-26-2010, 07:57 PM
  3. Check for unique key violation
    By andy16 in forum JDBC
    Replies: 6
    Last Post: 05-24-2010, 06:23 PM
  4. countin unique chars !
    By pauser in forum New To Java
    Replies: 4
    Last Post: 04-27-2010, 04:07 PM
  5. String Compare not working
    By Revelation in forum New To Java
    Replies: 3
    Last Post: 06-30-2007, 06:43 PM

Posting Permissions

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