How do I check if string contains substring?
Like this: …or you can use the tilde operator: This works because indexOf() returns -1 if the string wasn’t found at all. Note that this is case-sensitive.If you want a case-insensitive search, you can write Or: The latter is a regular expression or regex. Regex breakdown: / indicates this is a regex yes means that … Read more