title: Write longest and shortest palindrome from text file
body: <p>I am trying to write a program what will write longest and shortest palindrome from words in text file. My code looks like this now:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          string[] lines = System.IO.File.ReadAllLines(@"C:\palindromy.txt");
  
          foreach (string line in lines)
          {
              char[] charArray = line.ToCharArray();
              for (int i = 0; i &lt; 1; i++)
              {
                  Array.Reverse(charArray);
                  bool a = charArray.SequenceEqual(line);
                  while(a == true)
                  {                        
                      Console.WriteLine(line); /that will just write all palindroms
                      break;
                  }
              }
          }
      }
  </code></pre>
  
  <p>I am currently just writing all palindromes, but I need to write just longest and shortest one.</p>