Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ArrayList & Sub ArrayList Import CSV?

ArrayList & Sub ArrayList Import CSV?

Scheduled Pinned Locked Moved C#
data-structureshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gman44
    wrote on last edited by
    #1

    [data] string sbStrings = @"program files\software\program\report.htm,8/10/2006 4:23 pm-program files\software\program\report.htm,8/10/2006 2:25 pm-program files\software\program\report.htm,6/23/2006 8:14 pm-program files\software\program\report.htm,8/30/2006 1:12 pm"; Q. How would I split this , and - delimited string into a string [,] array? or use something like this: ArrayList list = new ArrayList(); list.Add(new ArrayList()); string1 string2 program files\softsoftware\program\help\help3.htm 9/22/2006 2:22 pm

    L 1 Reply Last reply
    0
    • G gman44

      [data] string sbStrings = @"program files\software\program\report.htm,8/10/2006 4:23 pm-program files\software\program\report.htm,8/10/2006 2:25 pm-program files\software\program\report.htm,6/23/2006 8:14 pm-program files\software\program\report.htm,8/30/2006 1:12 pm"; Q. How would I split this , and - delimited string into a string [,] array? or use something like this: ArrayList list = new ArrayList(); list.Add(new ArrayList()); string1 string2 program files\softsoftware\program\help\help3.htm 9/22/2006 2:22 pm

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      kvnsdr wrote:

      Q. How would I split this , and - delimited string into a string [,] array?

      public static string[] Tokenize(string name, params string[] delimiters)
      {
      for (int i = 0; i < delimiters.Length; i++)
      {
      delimiters[i] = Regex.Escape(delimiters[i]);
      }

      string del = string.Join("|", delimiters);

      Regex re = new Regex(del, RegexOptions.Compiled));

      List<string> tokens = new List<string>();
      int lastend = 0;

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups