Results 1 to 2 of 2

Thread: [RESOLVED] How do I split a string?

  1. #1

    Thread Starter
    Addicted Member tgf-47's Avatar
    Join Date
    Feb 2010
    Location
    CapeTown, South Africa -34.01244,18.337415
    Posts
    209

    Resolved [RESOLVED] How do I split a string?

    I have a string:
    vb.net Code:
    1. Dim strPath as string = "C:\abc\INV042.PDF"

    How do I cut the string so that I only have "INV042.PDF"?

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: How do I split a string?

    You can use String.Split method, but I advise to use System.IO.FileInfo class which already has this functionality and much more.

    Code:
    Dim fi As New IO.FileInfo("C:\abc\INV042.PDF")
    MsgBox fi.Name

Tags for this Thread

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