Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

String::EndsWith Method (String^, Boolean, CultureInfo^)

 

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

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public:
bool EndsWith(
	String^ value,
	bool ignoreCase,
	CultureInfo^ culture
)

Parameters

value
Type: System::String^

The string to compare to the substring at the end of this instance.

ignoreCase
Type: System::Boolean

true to ignore case during the comparison; otherwise, false.

culture
Type: System.Globalization::CultureInfo^

Cultural information that determines how this instance and value are compared. If culture is null, the current culture is used.

Return Value

Type: System::Boolean

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

Exception Condition
ArgumentNullException

value is null.

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.

The following example determines whether a string occurs at the end of another string. The EndsWith method is called several times using case sensitivity, case insensitivity, and different cultures that influence the results of the search.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft