You've stumbled across the archive of the blog posts I wrote some 8 years ago or so. Feel free to peruse, through everything from code snippets that never made it to GitHub, to random ramblings about my passion for technology.

So, I wrote this code, inspired by a Daily WTF post, which I wanted to make "more efficient":

public static string LastSixDigits(string number)
{
    return new List<string>(new string[] { number })
        .Where(n => !string.IsNullOrWhiteSpace(n) && n.Length >= 6)
        .DefaultIfEmpty(string.Empty)
        .First().Reverse().Take(6).Reverse()
        .Aggregate(string.Empty, (s, c) => s += c);
}

Continue reading...