📌  相关文章
📜  javascript word 开头 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:48.640000             🧑  作者: Mango

代码示例2
//checks if a string starts with a word
function startsWith(str, word) {
    return str.lastIndexOf(word, 0) === 0;
}
startsWith("Welcome to earth.","Welcome"); //true