Share via


GetFileNameWithoutExtension Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Returns the file name of the specified path string without the extension.

Namespace:  System.IO
Assembly:  System.IO (in System.IO.dll)

Syntax

'Declaration
Public Shared Function GetFileNameWithoutExtension ( _
    path As String _
) As String
public static string GetFileNameWithoutExtension(
    string path
)
public:
static String^ GetFileNameWithoutExtension(
    String^ path
)
static member GetFileNameWithoutExtension : 
        path:string -> string 
public static function GetFileNameWithoutExtension(
    path : String
) : String

Parameters

Return Value

Type: System. . :: . .String
The string returned by GetFileName, minus the last period (.) and all characters following it.

Remarks

This method does not verify that the path or file name exists.

.NET Framework Security

See Also

Reference

Path Class

System.IO Namespace