PowerShell: Join String

By Xah Lee. Date: .

💡 TIP: Operator names are case-insensitive.

Join String by Plus Operator: +

"a"+"b"+"c"
# "abc"

Operator: -join

-Join (str1, str2, etc)

Join strings. (Parenthesis required.)

-join ("a", "b", "c")
# "abc"
(str1, str2, etc) -Join delimiter
  • Join strings with delimiter.
  • delimiter is a string and can have multiple characters.
("a", "b", "c") -join " "
# "a b c"

Cmdlet: Join-String

There is also a Join-String cmdlet.

PowerShell String