Table of Contents

Method RemovePrefix

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

RemovePrefix(string?, string?, StringComparison)

Removes the specified prefix from the beginning of the input string, if present. Supports case-sensitive or case-insensitive comparisons using StringComparison.

public static string? RemovePrefix(string? input, string? prefix, StringComparison comparison = StringComparison.CurrentCulture)

Parameters

input string

The input string to evaluate.

prefix string

The prefix to remove from input.

comparison StringComparison

The string comparison mode used for prefix matching.

Returns

string

The input string without the prefix if it matched; otherwise, the original input. Returns null if input is null.