Results 1 to 3 of 3

Thread: [RESOLVED] Break down a Path String...

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2003
    Posts
    62

    Resolved [RESOLVED] Break down a Path String...

    What's the simplest way to break down a String with special characters in it?
    My String will be something like this...

    Text1.Text= "C:\Folder1\SubFolder1\Pic.jpg"

    I want to break it down to:

    Text2.Text = "C:"
    Text3.Text = "Folder1"
    Text4.Text = "SubFolder1"
    Text5.Text = "Pic.jpg"

    Thanks
    Last edited by Promocom; Sep 20th, 2007 at 10:08 PM.

  2. #2
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Break down a Path String...

    vb Code:
    1. Dim Path As String
    2. Dim SPath() As String
    3.  
    4. Dim SeparatedPath As String
    5.     Path = "C:\Folder1\SubFolder1\Pic.jpg"
    6.    
    7.     SPath() = Split(Path, "\", -1, vbTextCompare)
    8.     For i = 0 To UBound(SPath)
    9.    
    10.         SeparatedPath = SPath(i)
    11.        
    12.     Next
    Try This
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2003
    Posts
    62

    Re: Break down a Path String...

    Works greart! Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width