We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5a8689 commit a42149dCopy full SHA for a42149d
TOOL-Remove-StringSpecialCharacter/Remove-StringSpecialCharacter.ps1
@@ -1,6 +1,5 @@
1
-function Remove-StringSpecialCharacter
2
-{
3
-<#
+function Remove-StringSpecialCharacter {
+ <#
4
.SYNOPSIS
5
This function will remove the special character from a string.
6
@@ -50,7 +49,7 @@ function Remove-StringSpecialCharacter
50
49
[String[]]$SpecialCharacterToKeep
51
)
52
PROCESS {
53
- try{
+ try {
54
IF ($PSBoundParameters["SpecialCharacterToKeep"]) {
55
$Regex = "[^\p{L}\p{Nd}"
56
Foreach ($Character in $SpecialCharacterToKeep) {
@@ -71,7 +70,8 @@ function Remove-StringSpecialCharacter
71
70
Write-Verbose -Message "Original String: $Str"
72
$Str -replace $regex, ""
73
}
74
- }catch{
+ }
+ catch {
75
$PSCmdlet.ThrowTerminatingError($_)
76
77
} #PROCESS
0 commit comments