string operation in powershell

https://blogs.technet.microsoft.com/heyscriptingguy/2014/07/15/keep-your-hands-clean-use-powershell-to-glue-strings-together/

 powershell concat string

Substitution

Because the expanding string can become difficult to read, I often like to use substitution values and the format specifier. To do this, I create a string and parameters for place holders. My separator goes inside the string. Then I use the –f format operator and specify the values for {0} and {1}. This is shown here:

PS C:> "{0}, {1}" -f $s,$t

This is a string, a really cool string

需要注意,参数是需要逗号分隔的

原文地址:https://www.cnblogs.com/chucklu/p/9605744.html