algrithm for string search

Signed-off-by: Luo Chunbo <luochunbo@gmail.com>