Re: No StringCompare in Mathematica?
- To: mathgroup at smc.vnet.net
- Subject: [mg67185] Re: No StringCompare in Mathematica?
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Sun, 11 Jun 2006 02:19:13 -0400 (EDT)
- References: <e6e2oh$20u$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Steven T. Hatton wrote:
> I wanted to sort a list of XMLElements based on the text in the third
> descendent of the element type used to form the list. In order to set up
> the comparison predicate, I had to(?) form a list of the two candidate
> strings and compare it to the sorted version of itself. The sort was
> fairly slow in executing. I would like to have simply done s1 < s2, but
> Mathematica doesn't appear to support that. Is there a way to get that
> functionality more simply than what I described?
I am not totally clear what you are asking here, but if you want to
compare strings, try OrderedQ, for example:
OrderedQ[{"aac","aab"}]
David Bailey
http://www.dbaileyconsultancy.co.uk