On 22.06.2007 17:48 CE(S)T, Yves Goergen wrote:
> Match m1 = Regex.Match(param1, "^([0-9]+)");
> if (m1.Success)
> {
> Match m2 = Regex.Match(param2, "^([0-9]+)");
> if (m2.Success)
> {
> int cmpNum = int.Parse(m1.Groups[1].Value) -
> int.Parse(m2.Groups[1].Value);
> if (cmpNum != 0) return cmpNum;
> }
> }
> return String.Compare(param1, param2, true);
Oh, well, I just realised that this will only sort numbers "naturally"
at the beginning of strings, but not in the middle or at the end. It
will be a bit more complex to do that. Maybe I find a sort/compare
algorithm for it. But at least I know now that it's easy to use. :)
--
Yves Goergen "LonelyPixel" <[EMAIL PROTECTED]>
Visit my web laboratory at http://beta.unclassified.de
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------