Brute force string search algorithm