다음을 통해 공유


PackageUtilities.TrimPrefix(String, String, StringComparison) Method

Definition

Removes a string prefix from a string and returns the remainder of the string. If the string does not start with the prefix, returns the original string unchanged.

public static string TrimPrefix (this string s, string prefix, StringComparison stringComparision = System.StringComparison.OrdinalIgnoreCase);
static member TrimPrefix : string * string * StringComparison -> string
<Extension()>
Public Function TrimPrefix (s As String, prefix As String, Optional stringComparision As StringComparison = System.StringComparison.OrdinalIgnoreCase) As String

Parameters

s
String

The string to be stripped of a prefix.

prefix
String

The prefix to be stripped.

stringComparision
StringComparison

Optional StringComparison specification. Defaults to case-insensitive.

Returns

The string without its prefix.

Applies to