etc/Powershell
[Powershell] 출력 데이터 안에서 줄 바꿈 하기 - new line
이단서로
2023. 2. 23. 17:22
주제
출력 데이터 안에서 줄바꿈 하기
방법
`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
728x90