System.String.EndsWith Method

Determines whether the end of this string instance matches the specified string when compared using the specified culture.

Syntax

public bool EndsWith (string value, bool ignoreCase, System.Globalization.CultureInfo culture)

Parameters

value
The string to compare to the substring at the end of this instance.
ignoreCase
true to ignore case during the comparison; otherwise, false.
culture
Cultural information that determines how this instance and value are compared. If culture is null, the current culture is used.

Returns

true if the value parameter matches the end of this string; otherwise, false.

Remarks

This method compares the value parameter to the substring at the end of this string that is the same length as value, and returns a value that indicates whether they are equal. To be equal, value must be a reference to this same instance or match the end of this string.

This method performs a word (culture-sensitive) comparison using the specified casing and culture.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0