Reducing memory footprint in anagram-finding program for text public static bool IsAnagramOf(this string word1, string word2)
{
    return word1.OrderBy(x =&gt; x).SequenceEqual(word2.OrderBy(x =&gt; x));
}

public static void Main()
  {
    Console.SetIn(new StreamReader(Console.OpenStandardInput(8192)));
    string test = Console.ReadLine();
    string[] split = test.Split(new Char[] { ',', '.', ' ' },
                         StringSplitOptions.RemoveEmptyEntries);
    for (int i = 0; i &lt; split.Length; i++)
    {
        foreach (string s in split)
        {
            if (split[i] != s)
                if (split[i].IsAnagramOf(s))
                {
                    Console.WriteLine(s);

                }
        }

    }
    Console.ReadLine();
}
and just shortening it up Jesse's answer...

private static bool IsAnagramOf(this string word1, string word2)
{
    return word1
        .OrderBy(x =&gt; x)
        .SequenceEqual(word2.OrderBy(x =&gt; x));
}

static void Main(string[] args)
{
    using (var si = new StreamReader(Console.OpenStandardInput(8192)))
    {
        Console.SetIn(si);
        var split = (Console.ReadLine() ?? "").Split(new[] {',', '.', ' '}, StringSplitOptions.RemoveEmptyEntries);
        split.SelectMany(t =&gt; split.Where(s =&gt; (t != s) &amp;&amp; t.IsAnagramOf(s))).ToList().ForEach(Console.WriteLine);                
        Console.ReadLine();
    }
}