PackageUtilities.TrimPrefix(String, String, StringComparison) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.