【发布时间】:2014-08-07 17:05:21
【问题描述】:
我正在从文本文件中读取行,并希望去掉 n andr 和结尾空格:
$g = Get-Content -Encoding ASCII $Tests -ErrorAction Stop | Out-String
$g.Replace("`r","")
$g.Replace("`n","")
$g.trim()
#Before the a.m. lines I tried unsuccessfully:
$g.trim("`n`r ")
可能是编码 - 至少没有任何帮助?
我如何摆脱那个“编辑尾巴”
提前致谢
古力
【问题讨论】:
标签: powershell trim