Home > Code > C# > Identify the given text ends with specific string using String.EndsWith() method in C#.NET

Identify the given text ends with specific string using String.EndsWith() method in C#.NET

by Thamil   on Dec 19, 2011   Category: C#   |  Views: 1086    |  Points: 25   |  Gold 


Below code will help you to check whether the given text ends with specific mentioned string or not.

private void StringEndsWith()
{
string SampleString = "Identify the given text ends with specific string using String.EndsWith() method in C#.NET";
string GivenString = "in C#.NET";
if (SampleString.EndsWith(GivenString))
{
Response.Write("The Sample String ends with " + GivenString);
}
}




Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts