How to find contains string in Javascript

If you’re looking for a way to check if a string contains a specific word or phrase, there are a few different methods you can use.

Javascript

One option is to use the indexOf() method. This method returns the index of the first occurrence of a specified word or phrase in a string. If the word or phrase is not found…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Patrick Wan

Patrick Wan

My name’s Patrick. I’m a Software Developer, experience in Laravel, Vue Js, React Js, Livewire, Jquery, Codegniter, NPM, GIT. I have 5 years plus experience.