KMP string searching method