Handling strings using Powershell commands

This post is just about handling strings using powershell commands

##to split string that are separated with space

"Powershell is really cool" -split " "

##to join strings with pipe symbol

"Powershell 1.0","Powershell 2.0"-join "|"

##to compare string values

$A = "Powershell is really cool"
$B = "Powershell is really hot"

Compare-Object $A $B -includeequal

$C = "Powershell is really cool"
$D = "Powershell is really cool"

Compare-Object $C $D -includeequal

No comments: