[Solved] Check words that start and end with same letter in C#


You could use regex capturing group.

if(Regex.IsMatch(temp,@"^([a-zA-Z])[a-zA-Z]{3,}\1$"))

It should match the words which starts and endswith the same letter and the word must contain atleast 5 letters. For greater than 5 letters, just change the number 3 to 4.

3

solved Check words that start and end with same letter in C#