Assuming that you have a List<string>
as collection of words
// A simple method to reverse the string
public static string Reverse( string s )
{
char[] charArray = s.ToCharArray();
Array.Reverse( charArray );
return new string( charArray );
}
Usage:
var words = new List<String>();
var palindromes = words.Select(w => Reverse(w)); // this assumes that all the words are palindrome;
if you need to check for palindrome before selection then try this
var palindromes = words..Where(w => w == Reverse(w)).Select(w => Reverse(w)); // this assumes that all the words are palindrome;