Method RemovePrefixes
RemovePrefixes(string?, IEnumerable<string>, StringComparison)
Removes the specified prefixes from the beginning of the input string, if present.
public static string? RemovePrefixes(string? input, IEnumerable<string> prefixes, StringComparison comparison = StringComparison.CurrentCulture)
Parameters
inputstringThe input string to process.
prefixesIEnumerable<string>The prefixes to remove from
input.comparisonStringComparisonThe string comparison mode used for prefix matching.
Returns
- string
The input string without the prefixes if any matched; otherwise, the original input. Returns
nullifinputisnull.