GetExtensionFromPath (open)

Obtain the extension part from a path

Syntax

LOADLIB "wh::files.whlib";

STRING FUNCTION GetExtensionFromPath(STRING path)

Parameters

STRING path

Path to strip

Return value

STRING

The extension from the submitted path

Description

Strips the directory and filename from a complete path, leaving only the extension. This is only done for the path submitted to the function. No checks on disk or in the WebHare database are performed. Initial dots are ignored for extension matching

Examples

//Returns ".it"
PRINT(GetDirectoryFromPath("/my/dir/b-lex.it");