Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Comparison method violates its general contract!

if ( one.length() == 0 ) {
    if ( two.length() == 0 ) {
        return 0;               // BOth empty - so indicate
    }
    return 1;                   // empty string sorts last
}
if ( two.length() == 0 ) {
    return -1;                  // empty string sorts last                  
}
return one.compareToIgnoreCase( two );
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Comparison #method #violates #general
ADD COMMENT
Topic
Name
8+5 =