Share via


Path.HasExtension Method

Determines whether a path includes a file name extension.

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

Syntax

public static bool HasExtension (
         string path
)

Parameters

  • path
    The path to search for an extension.

Return Value

true if the characters that follow the last directory separator (\\ or /) or volume separator (:) in the path include a period (.) followed by one or more characters; otherwise, false.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

Path Class
Path Members
System.IO Namespace