Reading String String.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nady
    New Member
    • Mar 2009
    • 10

    Reading String String.

    Dear Techies,
    I have been working on a project now i have difficulty
    I am writing Filenames to the database like this C:\traffic\File No 1-2005\100-2005-1.jpg

    I am able to segrgate the 1-2005-1 part.
    I also need to separate the 100 part separatly

    Please help


    thanks
    Nadir
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Will one line due?

    Code:
                String LongFileName = @"C:\traffic\File No 1-2005\100-2005-1.jpg";
                string HundredPart = System.IO.Path.GetFileNameWithoutExtension(LongFileName).Split('-')[0];

    Comment

    • nady
      New Member
      • Mar 2009
      • 10

      #3
      Thanks a lot.
      it solved the issue

      Comment

      Working...