Table of Contents

Method HasExtension

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

HasExtension(string?, string, StringComparison)

Checks if the specified path has the given file extension.

public static bool HasExtension(string? path, string ext, StringComparison comparison = StringComparison.OrdinalIgnoreCase)

Parameters

path string

The path to check for the extension.

ext string

The file extension to check for.

comparison StringComparison

The StringComparison to use for the check.

Returns

bool

true if the path has the specified extension; otherwise, false.