Solidity - Template Literals

How do I use string template literals on Solidity like JavaScript offers out of the box?

I need to write a multiline string and would like to leverage something that doesn’t require me writing a bunch of /n

i.e.

myLongString = `
1- Chicken picanha cow ham tongue beef ribs flank prosciutto jerky pork chop leberkas shoulder. 

2- Pork chop jowl meatloaf andouille swine buffalo prosciutto brisket. Biltong filet mignon ham landjaeger pork beef ribs chuck pastrami cupim pork belly burgdoggen strip steak hamburger. 

3- Strip steak tenderloin pig, sirloin landjaeger drumstick pastrami short loin pork cupim chislic. Salami boudin sirloin pork belly short ribs pastrami swine bacon.
`

I don’t think it’s possible. Just reading the documentation doesn’t indicate a way to do that.

https://docs.soliditylang.org/en/v0.8.4/types.html?highlight=types#string-literals-and-types

Check out this question too.

1 Like