Question : js startswith
Answered by : qiankunli
var str = "Hello world, welcome to the universe.";
var n = str.startsWith("Hello");
Source : | Last Update : Fri, 20 Mar 20
Question : javascript string starts with
Answered by : code-grepper
//checks if a string starts with a word
function startsWith(str, word) { return str.lastIndexOf(word, 0) === 0;
}
startsWith("Welcome to earth.","Welcome"); //true
Source : | Last Update : Tue, 30 Jul 19