Sample code for 30+ languages & platforms
Xojo Plugin

Demonstrate Directory Path Functions

Demonstrates the path functions GetDirectoryName, GetExtension, GetFileName, and GetFileNameWithoutExtension.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim fac As New Chilkat.FileAccess

// Note: Chilkat accepts either forward slash or backslash chars as directory separators..
System.DebugLog(fac.GetDirectoryName("/MyDir/MySubDir/myfile.ext"))
System.DebugLog(fac.GetDirectoryName("/MyDir/MySubDir"))
System.DebugLog(fac.GetDirectoryName("/MyDir/"))
System.DebugLog(fac.GetDirectoryName("/MyDir"))
System.DebugLog(fac.GetDirectoryName("/"))

System.DebugLog(fac.GetExtension("C:/mydir.old/myfile.ext"))
System.DebugLog(fac.GetExtension("C:/mydir.old/"))

System.DebugLog(fac.GetFileName("C:/mydir/myfile.ext"))
System.DebugLog(fac.GetFileName("C:/mydir/"))

System.DebugLog(fac.GetFileNameWithoutExtension("C:/mydir/myfile.ext"))
System.DebugLog(fac.GetFileNameWithoutExtension("C:/mydir/"))

System.DebugLog("---")