Newlines in the Immediate Window

前端 未结 2 1905
自闭症患者
自闭症患者 2021-01-30 13:07

Using Visual Studio 2010 Professional, I have a ToString() method that looks like this:

public override string ToString()
{
    return \"something\"         


        
2条回答
  •  故里飘歌
    2021-01-30 13:16

    Actually there is a way. You can use format specifiers in the immediate window to change the format of the display. If you have a string with carriage returns and linefeeds in it ("\r\n") you can follow the print request with the 'no quotes' format specifier.

    In the immediate window type:

    ?MyObj.ToString(),nq
    

    and the \r\n will cause newlines in the immediate window.

    For more info on format specifiers see: http://msdn.microsoft.com/en-us/library/e514eeby.aspx

提交回复
热议问题