Jump to content
Xtreme .Net Talk

ddx

Members
  • Posts

    3
  • Joined

  • Last visited

ddx's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello, I have this array: [3,1,2,2] [2,8,7,1] [3,3,9,6] [1,4,3,5] and i'd like to sort it in ascending order by the first element into: [1,4,3,5] [2,8,7,1] [3,1,2,2] [3,3,9,6] I tried Array.Sort by that only works for 1 dimensional arrays. How does one accomplish this in C#? Many Thanks.
  2. Oops... small typo above. i meant to write oMatch.Length not Match.Length. I corrected the original post.
  3. Background: I'm using Regex.Match and string expressions for string matching. For instance, if: String sMatchString = @"SOFT>?(WARE)"; and sString = "SOFTWARE", then I get oMatch.Length > 0 from: Match oMatch = Regex.Match(sString, sMatchString); And oMatch.Length < 0 if sString is anything else such as "SOFTWXRE" My problem: I want to invert the evaluation of sMatchString . I want oMatch.Length to be > 0 if sString contains at its end anything *except* "WARE". I thought i could simply insert the ! operator like so: String sMatchString = @"SOFT>?(!WARE)"; so that if sString = "SOFTWXRE" then oMatch.Length would be > 0. But this does not work. What is most frustrating is that following 'prefix' approach does work: String sMatchString = @"(?<!SOFT)WARE"; Suggestions?
×
×
  • Create New...