#javascript
#string
#substring
Usually I would expect a String.contains() method, but there doesn't seem to be one.
What is a reasonable way to check for this?
String.prototype.includes: https://developer.mozilla.org/en-US/d...
is not supported by Internet Explorer: https://caniuse.com/#closures polyfill: https://github.com/zloirock/core-js/b...
String.prototype.indexOf: https://developer.mozilla.org/en-US/d...
Watch video How to check whether a string contains a substring in JavaScript? online without registration, duration hours minute second in high quality. This video was added by user Code Samples 18 March 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 69 once and liked it 2 people.