Here if I try to search with full sentence Search function is not working. Please let me know what is the solution if I need to search with the strings separated by "?"
function myFunction() {
var str = "How are You? I'm good";
var n = str.search("How are You? I'm good");
document.getElementById("demo").innerHTML = n;
}
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>