Sorting filtered strings