Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

IndexOf - If Part Of A String Contains "Text" For Example.

DZone's Guide to

IndexOf - If Part Of A String Contains "Text" For Example.

·
Free Resource
So here, if the string pageName contains "Text" the statement will output positive



if (pageName.indexOf("Text")!= -1)
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}