How to Check If a String Contains Another Substring in JavaScript Check if String contains specific Character in JavaScript When a substring cannot be found, it returns -1. We will print to the webpage if it contains the character in the string otherwise not. Many times you need to validate the text field for special characters and HTML tags in jQuery validation. 10 years ago. i will give you simple example of laravel str contains case insensitive. If the word or substring is present in the given string, the includes () method returns true; otherwise, it returns false. Check if String Contains a Specific Word in JavaScript Use the Contains method to check if a string contains a word or not. To check whether string contains particular text or not in jQuery we need to write the code like as shown below.