I would like to use a multi-character string as a single delimiter in the .Split() method.
As shown in the sample below, I would like 'abc' to act as the delimiter, with the result being two elements.
'The cat had ' and '/ tacos at lunch'
I amm missing something in the way PowerShell interprets the 'abc' value. It appears it is splitting on the individual characters AND whitespace. I'm not a regex guy. Splitting on a single character, /, works as expected.
CLS
Get-Date
$strSplitOn = 'abc'
#$strSplitOn = '/'
$strSplitText = 'The cat had abc/ tacos at lunch'
$arrTemp = $strSplitText.Split( $strSplitOn )
Write-Host ' Elements: ' $arrTemp.Length
ForEach( $strItem IN $arrTemp )
{ Write-Host $strItem }
"`r`nDone..."