Javascript 如何将字符串附加到另一个具有多行且以反斜杠字符结尾的字符串

Javascript 如何将字符串附加到另一个具有多行且以反斜杠字符结尾的字符串,javascript,string,Javascript,String,我想将字符串变量附加到另一个字符串。第二个字符串包含大量多行字符,并用反斜杠(“\”)分隔 我正在寻找javascript的解决方案 比如说 var one = 'test string one'; var two = 'test string two\ is seperated by back slash and this string has\ multiple number of lines'; 现在我想将字符串1附加到字符串2

我想将字符串变量附加到另一个字符串。第二个字符串包含大量多行字符,并用反斜杠(“\”)分隔

我正在寻找javascript的解决方案

比如说

var one = 'test string one'; 

var two = 'test string two\
              is seperated by back slash and this string has\
              multiple number of lines';
现在我想将字符串1附加到字符串2,如下所示

var two = 'test string two'+one+\
              is seperated by back slash and this string has\
              multiple number of lines';

我正在寻找用第二个字符串附加第一个字符串。任何帮助都将不胜感激。

您必须用
重新开始strig文本。

'test string two' + one + '\
 is seperated by back slash and this string has\
 multiple number of lines';
或者使用模板字符串,则根本不需要换行符:

`test string two ${one}
 is seperated by back slash and this string has
 multiple number of lines`

您必须用
重新开始strig文本:

'test string two' + one + '\
 is seperated by back slash and this string has\
 multiple number of lines';
或者使用模板字符串,则根本不需要换行符:

`test string two ${one}
 is seperated by back slash and this string has
 multiple number of lines`

我可以在我的第二个字符串中输入如下'\'@nalla是的,你可以用反斜杠代替“”?。我正在寻找第二个字符串中的反斜杠,如下“\”@nalla是的,你可以
t我们用反斜杠代替“
”?。我在找反斜杠