How does Stack Overflow generate its SEO-friendly URLs?
Here’s how we do it. Note that there are probably more edge conditions than you realize at first glance. This is the second version, unrolled for 5x more performance (and yes, I benchmarked it). I figured I’d optimize it because this function can be called hundreds of times per page. /// <summary> /// Produces optional, … Read more