NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

File.HasExtension

Determines whether a path includes a file extension.

[Visual Basic]
Public Shared Function HasExtension( _
   ByVal path As String _
) As Boolean
[C#]
public static bool HasExtension(
   string path
);
[C++]
public: static bool HasExtension(
   String* path
);
[JScript]
public static function HasExtension(
   path : String
) : Boolean;

Parameters

path
The path to test.

Return Value

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

Exceptions

Exception Type Condition
ArgumentException path is empty or contains only whitespaces.

Remarks

The return value is determined by searching backwards for "." within path. If "." is matched before Environment.DirectorySeparatorChar, Environment.AltDirectorySeparatorChar, or Environment.VolumeSeparatorChar is encountered, then true is returned. Otherwise, false is returned.

See Also

File Class | File Members | System.IO Namespace