1.Method 1
string input = "www.dotnetfunda.com";
string[] arr = new string[] { ".net", ".com", ".in" };
// Loop through and test each string
foreach (string ss in arr)
{
if (input.EndsWith(ss))
{
A.WriteLine(ss);
}
}
2.Method 2
//condition using
string name="Gowthaman Vimal";
if (name.EndsWith("Vimal"))
{
A.WriteLine(name);//endwith "Vimal" true
}
else
{
A.WriteLine("i Can't find");
}