Hi,

The following seems to work (based on code reading + testing):

var str = "hello";
var s = "$\{str} world";
print(s); // prints ${str} world
var s1 = "${str} world";
print(s1) // prints "hello world"

Still, I've filed a bug to clarify and document expected, supported behaviour.

https://bugs.openjdk.java.net/browse/JDK-8073613

Thanks,
-Sundar

On Sunday 22 February 2015 04:57 PM, Anthony Vanelverdinghe wrote:
Hi

How can I avoid string interpolation in here documents with Nashorn? In other words: what if the here document contains the literal string "${a}"? The user guide section on here documents [1] doesn't tell how to do this.
If this is not available yet, shall I create a bug report for this?

Kind regards, Anthony

[1] http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/shell.html#sthref26

Reply via email to