contains Summary Checks if the string contains the specified substring. Usage public bool contains(string substr) Returns true if the substring is contained in the string and false if the substring is not found in the string. Parameters substr The substring to search for. Description Checks if the string contains the specified substring. The search performed is case-sensitive. Examples Basic Usage 1234567import System; string letters = "abcdef";Console.log(letters.contains("a")); // trueConsole.log(letters.contains("abc")); // trueConsole.log(letters.contains("def")); // trueConsole.log(letters.contains("zzz")); // false Share HTML | BBCode | Direct Link