C# String EndsWith(String)
Description
String EndsWith(String)
determines whether the end
of this string instance matches the specified string.
Syntax
String.EndsWith(String)
has the following syntax.
public bool EndsWith(
string value
)
Parameters
String.EndsWith(String)
has the following parameters.
value
- The string to compare to the substring at the end of this instance.
Returns
String.EndsWith(String)
method returns true if value matches the end of this instance; otherwise, false.
Example
The following example demonstrates how you can use the EndsWith method.
/*ww w . j a va 2s . c o m*/
using System;
public class EndsWithTest {
public static void Main() {
Console.WriteLine("<>".EndsWith(">"));
}
}
The code above generates the following result.