Visual Basic Core Snippet Routines
UnqualifyPath
          
                 
   Removes the trailing slash from a path if present to create an unqualified path.     
           Updated:   Monday December 26, 2011   
click to copy code:  


   Applies to:   VB4-32, VB5, VB6   
OS restrictions:   None  
 Code Snippet
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright 1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce 
'               or publish this code on any web site,
'               online service, or distribute as source 
'               on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Function UnQualifyPath(sPath As String) As String
 
   If Len(sPath) > 0 Then
   
      sPath = Trim$(sPath)
 
      If Right$(sPath, 1) = "\" Then
         UnQualifyPath = Left$(sPath, Len(sPath) - 1)
      Else
         UnQualifyPath = sPath
      End If
      
   Else
      UnQualifyPath = ""
   End If
   
End Function

 Calling Syntax
   sUnqualifiedPath = UnQualifyPath(sPath)

 Comments / Related
demo in use:  FindFirstFile: An API 'FolderExists' Routine
Checking for Media Availability Using DeviceIoControl
Loading and Ejecting Removable Media Using DeviceIoControl
Locking Removable Media Devices Using DeviceIoControl
SHBrowseForFolder: Pre-selecting Folders using a Browse Callback
CopyFileEx: Create a File Backup App
CopyFileEx: Create a File Backup App with a Progress Callback
   
Related:   QualifyPath

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright 1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter