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

Untitled

By: a guest on Jun 4th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 14  |  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. Issue with String.split
  2. while ((tempString = streamReader.ReadLine()) != null)
  3.         {
  4.             String [] split = tempString.Split('~');
  5.  
  6.             typeOfVehicle = split[0];
  7.             manufactuer = split[1];
  8.        
  9. String[] split = tempString.Split('~');
  10.  
  11. try
  12. {
  13.     typeOfVehicle = split[0];
  14.     manufactuer = split[1];
  15. }
  16. catch
  17. {
  18.     Console.WriteLine("Oops! It didn't work.");
  19.     Console.WriteLine("The offending string was "{0}"", tempString);
  20. }