PathUtil::SafeGetExtension Method (String^)

Visual Studio 2015
 

Return the extension of the specified path string.

Namespace:   Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Utilities (in Microsoft.VisualStudio.Utilities.dll)

public:
static String^ SafeGetExtension(
	String^ path
)

Parameters

path
Type: System::String^

The path from which to get the extension

Return Value

Type: System::String^

The extension, or the empty string if the extension could be not obtained.

This always returns a non-null string for the extension. It will return the empty string if:

  • path is null

  • path contains invalid path characters

  • path is empty

  • path does not contain an extension

Otherwise, path's extension (including the period ".").

Return to top
Show: