[.NET CORE]stringbuilder클래스 AppendLine()

해내면 그만!XX·2022년 5월 5일
0

stringbuilder클래스 .AppendLine()
: 현재 StringBuilder 개체의 끝에 지정한 문자열의 복사본과 기본 줄 종결자를 차례로 추가합니다.

using System;
using System.Text;

class Sample
{
    public static void Main()
    {
    StringBuilder sb = new StringBuilder();
    string        line = "A line of text.";
    int           number = 123;

// Append two lines of text.
    sb.AppendLine("The first line of text.");
    sb.AppendLine(line);
    }
}

결과
The first line of text.
A line of text.

한줄 엔터의 효과가 있다.

0개의 댓글