How do you check if one string contains a substring in JavaScript?

Learn eight methods for determining if a string contains a substring in JavaScript.

By Craig Buckler
October 25, 2016
Screenshot from "How do you check if one string contains a substring in JavaScript?" Screenshot from "How do you check if one string contains a substring in JavaScript?"

Determining if a string contains a substring is an essential task in any programming language. In this video, Craig Buckler lays out eight different approaches to this problem including string methods new to ECMAScript 2016. Novice-level JavaScript programmers will become familiar with all of the options at their disposal, including regular expressions.

Access in-depth JavaScript training with our Beginning JavaScript Learning Path.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

Craig Buckler is an experienced Web Developer working in the UK who started his career creating desktop software. Craig has worked for a number of well-known companies, including Microsoft, MSN, and Thomson Reuters, as well as the UK & EU governments. Craig is the prolific author of countless articles and tutorials on HTML5, CSS3, JavaScript, JQuery, PHP, and Node.js.

Post topics: Web Programming
Post tags: Questions
Share: