Table of Contents

Method RemovePrefix

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

RemovePrefix(IEnumerable<string?>, string, StringComparison)

Removes the specified prefix from each string in the sequence, using the given comparison rule.

public static IEnumerable<string?> RemovePrefix(IEnumerable<string?> items, string prefix, StringComparison comparison = StringComparison.CurrentCulture)

Parameters

items IEnumerable<string>

The collection of strings to process.

prefix string

The prefix to remove from each string.

comparison StringComparison

The StringComparison option to use when matching the prefix. For example, use OrdinalIgnoreCase for case-insensitive matching.

Returns

IEnumerable<string>

A sequence of strings with the prefix removed where applicable. If an item does not start with the prefix (based on the specified comparison), it is returned unchanged.