且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将数组元素添加到字符串

更新时间:2022-11-18 23:09:49

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.