Create a multiline string in C#

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 3

  • @yosiyosiro3866
    @yosiyosiro3866 10 месяцев назад

    This tip is amazing for dealing with multiline output string. Thanks a lot.

  • @lumeronswift
    @lumeronswift Год назад

    Is there some kind of workaround in the case of needing an unknown number of quotation marks in the literal? Rare use case, perhaps, but is there a way to start/end the literal definition in a way that ignores collections of quotations in the middle?

    • @EverythingCSharp
      @EverythingCSharp  Год назад

      Unfortunately, you have to specify an exact number of double quotes in the start/end markers. But because you are adding/pasting a fixed string into the literal you can at least search that literal to ensure you will not have a problem. Also, if your using Visual Studio or VS Code, the editor should give an error because it has stopped the literal from compiling.