Check if a string is within a string (indexOf)

1
2
const string = "I am a swearing phrase, fuck";
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Use this method to check weather a word or a longer part of sentence is contained within a string.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.