Try the following example in an anonymous Apex window:
String s = '- Default - '; system.debug(s.CompareTo('Banner')<0); // True system.debug(s<'Banner'); // False s = '/ Default -'; system.debug(s.CompareTo('Banner')<0); // True system.debug(s<'Banner'); // true
Lexically, '- Default' is smaller than Banner because the '-' is smaller than 'B'. And the CompareTo operator works accordingly. But a regular string compare is treating the '-' seemingly as a special case, thus '- Default' is being treated as larger than 'Banner'. I'm guessing that Apex is treating the dash as a hyphen and excluding it from the comparison? It obviously isn't ignoring punctuation as evidenced by the '/' example.
I haven't yet found any documentation in the Apex reference or elsewhere that specifies what is going on here.
So my question is: Is this expected behavior, and if so, does anyone know where it is documented?