Given a string of text “my search phrase”, inside an html content block, how would you determine if the string appears within the first 100 or last 100 non tag-based characters of the document? (Don’t count html tags, only text nodes)
Example, this would return true…
<p>This html text block contains <b>My Search Phrase</b>, because it appears in the first 100 characters of the content.</p>
In the absence of any definition of “non-tag-based characters, I assume these are any characters of the string value of the document:
string(/).Therefore:
returns
true()exactly when the first 100 characters of the string value of the document contain the string'my search phrase'.Similarly:
returns
true()exactly when the last 100 characters of the string value of the document contain the string'my search phrase'.Therefore:
returns
true()exactly when the first or last 100 characters of the string value of the document contain the string'my search phrase'.