주제

 

출력 데이터 안에서 줄바꿈 하기

 

 

 방법

 

`n을 사용하면 된다.(` esc키 아래에 있는 기호)

 

 

 

  예제

 

PS C:\> $data = @('Zero','One','Two','Three')
PS C:\>
>> foreach($i in 0..($data.Length)) {
>>   if($i -gt 0) {
>>     "`n" + $data[$i]
>>   }
>>   else {
>>     $data[$i]
>>   }
>> }
Zero

One

Two

Three


PS C:\>

 

 관련글

 

2023.02.23 - [etc/Powershell] - [Powershell] 배열 사용하기

 

 

 출처

 

Microsoft

about_Special_Characters

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_special_characters?view=powershell-7.3 

 

 

 

 

 

 

+ Recent posts