javascript - How can i concatenate 2 strings in node.js? - Stack Overflow

var link = 'https:thisIsAlink'var line = 'this is a line'what i have done isvar

var link = 'https://thisIsAlink'
var line = 'this is a line'

what i have done is

var full_path = session.send(link + line)

The output i got :https://thisIsAlink this is a line
The output i want :https://thisIsAlinkthis is a line

var link = 'https://thisIsAlink'
var line = 'this is a line'

what i have done is

var full_path = session.send(link + line)

The output i got :https://thisIsAlink this is a line
The output i want :https://thisIsAlinkthis is a line

Share Improve this question edited Jan 19, 2023 at 16:34 OneCricketeer 192k20 gold badges142 silver badges268 bronze badges asked Dec 8, 2017 at 10:20 user9068379user9068379 211 gold badge1 silver badge4 bronze badges 2
  • 1 Having reread the question I realise that I got your desired and actual output backwards. There is no way that the code you provided will give the result you describe. The space can't appear from nowhere. – Quentin Commented Dec 8, 2017 at 10:42
  • jsbin./sigocezesu/1/edit?js,console – Quentin Commented Dec 8, 2017 at 10:44
Add a ment  | 

1 Answer 1

Reset to default 2
Var1 = 'this sentence'
Var2 = 'new sentence'
Var2 += Var1

This output is : new sentencethis sentence
If you want just switch the contat and you get the opposite

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745274088a4619928.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信