\n not working in google apps script Browser.msgBox

前端 未结 2 1350
醉话见心
醉话见心 2021-02-12 15:51

I am trying the following to add line breaks to a message box but it is not working.

function showMsgBox(){
  var msg = \'name: \\n \\n \\n Doc URL\';
  Browser.         


        
相关标签:
2条回答
  • 2021-02-12 15:53

    You need to double-escape "\n" for historical reasons

    function myFunction() {
      Browser.msgBox("Hello\\nWorld")
    }
    
    0 讨论(0)
  • 2021-02-12 16:08

    Yeah, you are right. msgBox do not respect extra whitespace or newline. A similar issue has been raised in Issue Tracker. You may star it and provide your feedback there.

    Issue 1608: Add an option to Browser.msgBox() to respect whitespace

    0 讨论(0)
提交回复
热议问题