String str= "web/abc.aspx";
if (str. EndsWith ("abc.aspx"))
{
This method compares value with a substring at the end of this instance, the same length as value, and returns an indication that they are equal. to be equal,value must be a reference to this same instance, or match the end of this instance.
This method performs a word (case-sensitive and culture) comparison using the current culture.
}
Else
{
Description of the caller
Such asAs described in best practices for using strings in the. NET Framework, we recommend that you avoid invoking a string comparison method that replaces the default value, but instead call a method that requires an explicit parameter to be specified. to use the string comparison rules of the current culture to determine whether a string begins with a specific substring, use StringComparison for its comparisonType parameter . the value of CurrentCulture calls the EndsWith (String, StringComparison) method overload.
}
String comparison to. Net String.endswith method (string)