Ken Kazinski
Ken Kazinski

Reputation: 27

PowerShell Not Finding a Replacing Section Character

I created a list and then read in data from a database table.

[System.Collections.ArrayList]$RawNotes = @()

I read in the data to the list:

foreach ($TmpRow in $Datatable) {
    $RawNotes.Add($TmpRow.Notes) | Out-Null
}
   

When I try to find the items that start with a section sign and a period my match never returns true so I am not sure what I am missing.

 if ($RawNotes[$index] -match ("^\s*§\.")) {
    $RawNotes[$index] = $RawNotes[$index]  -replace "^\s*§\.", ""
 }

I tried to use the unicode equivalent [U+00A7] but that did not work either.

Any help would be appreciated.

Upvotes: 0

Views: 41

Answers (0)

Related Questions