E.g. I have sample string as below:
var str = "Visit ? W3Schools ??"
I want to find the double question mark "??" exist in that string.
Anyone can help will be appreciated.
E.g. I have sample string as below:
var str = "Visit ? W3Schools ??"
I want to find the double question mark "??" exist in that string.
Anyone can help will be appreciated.
Use indexOf('??')
:
var str = "Visit ? W3Schools ??";
console.log(str.indexOf('??'));
NOTE that if you use
includes()
it will not work in IE browser.