Determines whether the end of this string instance matches the specified string when compared using the specified comparison option.
![]()
true if the value parameter matches the end of this string; otherwise, false.
The string.EndsWith(string, StringComparison) method compares the value parameter to the substring at the end of this string and returns a value that indicates whether they are equal. To be equal, value must be a reference to this same string, must be the empty string (""), or must match the end of this string. The type of comparison performed by the string.EndsWith(string, StringComparison) method depends on the value of the comparisonType parameter.