multiline strings

Topics: Language Specification
Jan 29, 2013 at 11:00 AM
Edited Jan 29, 2013 at 11:01 AM

Hello,

could be have the multiline string convention of c#into typescript?

myString1 :string = "This is the first line of my string.\n" +
                   "This is the second line of my string.\n" +
                   "This is the third line of the string.\n";


myString2 :string = @"This is the first line of my string.
This is the second line of my string.
This is the third line of the string.";

best regards

Xavier

Coordinator
Jan 29, 2013 at 5:56 PM

TypeScript is a superset of the JavaScript language.  One of the things we try to keep especially close to JavaScript are our expressions.  We try to not introduce anything new at the expression level that isn't part of the draft specification. 

That said, there is some work on template strings in the new version of JavaScript.  You can see a bit more on this feature request: http://typescript.codeplex.com/workitem/19

Coordinator
Jan 29, 2013 at 5:59 PM

Sorry, misread initially.  This should go to your other suggestion.  Still, we very much are trying to keep the expressions in the language to be only those of the recommended ECMAScript 6 standard (the upcoming version of JavaScript), and to not introduce new syntax.