using System;
public class Program
{
public static int CheckChar(string strValue)
{
char [] srtChar=strValue.ToCharArray();
if(srtChar[0]==srtChar[strValue.Length-1])
{
return 1;
}
else
{
return -1;
}
}
public static void Main()
{
string strValue;
int retValue;
Console.Write("Enter Your String:");
strValue=Console.ReadLine();
retValue=CheckChar(strValue);
if(retValue==1)
{
Console.Write("First and Last Text Match");
}
else
{
Console.Write("First and Last Text Not Match");
}
}
}This code explains how to find first and last letter is whether same or not in word or sentence.
