PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

Update Remove-StringDiacritic.ps1

Open dkabal14 opened this issue 2 years ago • 1 comments

I added a way to run the function in objects, so you can bulk remove diacritics from any powershell object, even imported CSV and JSON files

dkabal14 avatar Mar 16 '23 18:03 dkabal14

I added a section to replace the upside down ? and ! used in Spanish and a section to remove extra spaces, can you include this in your official version? # Normalize the String $Normalized = $StringValue.Normalize($NormalizationForm) # Replace the special punctuation characters $Normalized = $Normalized.Replace("¿", "?") $Normalized = $Normalized.Replace("¡", "!") # Remove extra spaces $Normalized = $Normalized -replace '\s{2,}', ' ' $NewString = New-Object -TypeName System.Text.StringBuilder

pmkochie avatar Sep 28 '23 15:09 pmkochie