search() 會尋找指定字串或正則表達式,並回傳起始位置。
"I love lvye".search("lvye"); // 7 "I love lvye".search("html"); // -1
找不到時回傳 -1。