Étiquette : indexOf

[Javascript] Vérifier qu’une chaîne de caractères string contient une sous-chaîne substring spécifique avec les méthodes includes ou indexOf

Source: en ES6 et pour Internet Explorer How to check whether a string contains a substring in JavaScript?

ES6

ES5 ou plus ancien (Internet Explorer)

Exemple in the field: