如何将数组元素添加到字符串
问题描述:
大家好
以下是我在阵列中获取元素的代码
Hi all
Below is the code where i am getting elements in array
$a=@($Split_ResultOfMasterListUser)
$a | Sort-Object | Get-Unique
以下是powershell控制台中的示例输出
below is the sample output in powershell console
root
sh506pa
snapp
sshd
su004sa
sys
tr005ma
trnadm
uucp
ve001na
vendabe
we002za
webm
webmd
wipftp
zapftp
现在我想将这些值分配给以逗号(,)加入的字符串
例如
now i want to assign these values to a string joining by comma(,)
e.g.
,nex3mzn,nex3slw,nex3orp,nex87vj,nex7uxw,nex7geg,nex7lmw,nex3hxf,nex8fas,root,bin,root,bin,sys,bin,adm,nuucp,uucp,
请告诉我怎么做。
Please tell me how to do this.
答
a = @(
Split_ResultOfMasterListUser)
Split_ResultOfMasterListUser)
a | Sort-Object | Get-Unique
a | Sort-Object | Get-Unique
以下是powershell控制台中的示例输出
below is the sample output in powershell console
root
sh506pa
snapp
sshd
su004sa
sys
tr005ma
trnadm
uucp
ve001na
vendabe
we002za
webm
webmd
wipftp
zapftp
现在我想将这些值分配给以逗号(,)加入的字符串
例如
now i want to assign these values to a string joining by comma(,)
e.g.
,nex3mzn,nex3slw,nex3orp,nex87vj,nex7uxw,nex7geg,nex7lmw,nex3hxf,nex8fas,root,bin,root,bin,sys,bin,adm,nuucp,uucp,
请告诉我怎么做。
Please tell me how to do this.