Here documents: how to avoid string interpolation?

A. Sundararajan sundararajan.athijegannathan at
Mon Feb 23 04:03:06 UTC 2015


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 


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] 

More information about the nashorn-dev mailing list