PackageUtilities.TrimSuffix(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 suffix from a string and returns the remainder of the string. If the string does not end with the suffix, returns the original string unchanged.
public static string TrimSuffix (this string s, string suffix, StringComparison stringComparision = System.StringComparison.OrdinalIgnoreCase);
static member TrimSuffix : string * string * StringComparison -> string
<Extension()>
Public Function TrimSuffix (s As String, suffix As String, Optional stringComparision As StringComparison = System.StringComparison.OrdinalIgnoreCase) As String
Parameters
- s
- String
The string to be stripped of a suffix.
- suffix
- String
The suffix to be stripped.
- stringComparision
- StringComparison
Optional StringComparison specification. Defaults to case-insensitive.
Returns
The string without its suffix.