Nashorn - includes/contains

Joshua Brodie josbrodie at gmail.com
Thu May 16 14:57:13 EDT 2019


I'm a novice with Nashorn (+ Javascript, if it is similar).

Is there a straightforward way to find out if a string contains a substring
value?

Say, 'thisString' contains 'foobar'?

if (thisString.includes("foobar"))

{

      addToString.getValues().add("foobar Included");

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20190516/fef122ce/attachment.html>


More information about the users mailing list