Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. read serial numbers with regex and place them as individual elements of a List<string>
  2. string[] mySerialNumbers = searchString.Split(new char[]{' '});
  3.        
  4. List<string> mySerialNumbers = new List<string>(searchString.Split(new char[]{' '});
  5.        
  6. foreach(Match match in Regex.Matches("1108656 1108657 1108658 1108659", "[0-9]{5,8}"))
  7. {
  8.     // Do something with match.Value here like : int.Parse(match.Value)
  9. }
  10.        
  11. string[] SerialNum = Regex.Split("yourStringVar", " ")