Mercurial > projects > dwt-linux
comparison dwt/dwthelper/utils.d @ 254:8bca790583c3
Fix string compare in dwthelper/utils
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 08 Jun 2008 15:11:48 +0200 |
parents | 66441b183ff5 |
children | 5a30aa9820f3 |
comparison
equal
deleted
inserted
replaced
253:cf113c9ff968 | 254:8bca790583c3 |
---|---|
589 public bool equalsIgnoreCase( String src, String other ){ | 589 public bool equalsIgnoreCase( String src, String other ){ |
590 return tango.text.Unicode.toFold(src) == tango.text.Unicode.toFold(other); | 590 return tango.text.Unicode.toFold(src) == tango.text.Unicode.toFold(other); |
591 } | 591 } |
592 | 592 |
593 public int compareToIgnoreCase( String src, String other ){ | 593 public int compareToIgnoreCase( String src, String other ){ |
594 return tango.text.Unicode.toFold(src) < tango.text.Unicode.toFold(other); | 594 return compareTo( tango.text.Unicode.toFold(src), tango.text.Unicode.toFold(other)); |
595 } | 595 } |
596 public int compareTo( String src, String other ){ | 596 public int compareTo( String src, String other ){ |
597 return src < other; | 597 return typeid(String).compare( cast(void*)&src, cast(void*)&other ); |
598 } | 598 } |
599 | 599 |
600 public bool startsWith( String src, String pattern ){ | 600 public bool startsWith( String src, String pattern ){ |
601 if( src.length < pattern.length ){ | 601 if( src.length < pattern.length ){ |
602 return false; | 602 return false; |