How to get file name without extension from path in VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Dim s As String
        Dim filename As String

        s = "d:\\data.txt"

        filename = Path.GetFileNameWithoutExtension(s)

        Console.WriteLine(filename)

    End Sub

End Module

' run:
' 
' data

 



answered Aug 16, 2018 by avibootz
...