hello,
i was just wondering as to what is the major difference between the Endswith() and Equals() method in .net (c#) ?
I wrote the following code for string comparison n also for numerals by using Endswith method however even if i use Equals method i get the same output ! can ne one plz guide me on this...as to when to use Endswith() and when to use Equals() ??
private void btncompare_Click(object sender, EventArgs e)
{
string str = str1.Text.Trim();
string strcmp = str2.Text.Trim();
if (str.EndsWith(strcmp))
{
MessageBox.Show("Strings are Equal");
}
else
{
MessageBox.Show("Strings are not Equal");
}
THANK YOU,
ROHAN