Check if a string contains a substring in JavaScript.

Publié le: 01 août 2022
sur la chaîne: Anil Bhatt
1,592
34

In this short video, I tried to quickly tell you all about the includes() method and indexOf() method in JavaScript, used to find the substring in a string.

String.includes() :-
It's a simple method that returns a boolean value depending on whether the string contains the substring or not.

String.indexOf() :-
This method returns the index of the substring, you need to compare it to -1 to know if the substring was found or not.

Thanks for watching.
#javascript


Sur cette page du site, vous pouvez voir la vidéo en ligne Check if a string contains a substring in JavaScript. durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Anil Bhatt 01 août 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,592 fois et il a aimé 34 téléspectateurs. Bon visionnage!