String concatenation in PowerShell

PowerShell

Here is an example of using string concatenation.


$txt1 = 'Two';

$txt2 = 'Items';

$concatenated = -join($txt1, ' --- ', $txt2)


Of course, we can also use string interpolation "$txt1 --- $txt2"

Post a Comment

Previous Post Next Post