string: add common string search function

Signed-off-by: Micky Ching <mickyching@gmail.com>