Over a million developers have joined DZone.

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

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



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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}