Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,47 +0,0 @@
|
|||
function Remove-Character
|
||||
{
|
||||
[CmdletBinding(DefaultParameterSetName="Control and Extended")]
|
||||
[OutputType([string])]
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=0)]
|
||||
[string]
|
||||
$String,
|
||||
|
||||
[Parameter(ParameterSetName="Control")]
|
||||
[switch]
|
||||
$Control,
|
||||
|
||||
[Parameter(ParameterSetName="Extended")]
|
||||
[switch]
|
||||
$Extended
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
filter Remove-ControlCharacter
|
||||
{
|
||||
$_.ToCharArray() | ForEach-Object -Begin {$out = ""} -Process {if (-not [Char]::IsControl($_)) {$out += $_ }} -End {$out}
|
||||
}
|
||||
|
||||
filter Remove-ExtendedCharacter
|
||||
{
|
||||
$_.ToCharArray() | ForEach-Object -Begin {$out = ""} -Process {if ([int]$_ -lt 127) {$out += $_ }} -End {$out}
|
||||
}
|
||||
}
|
||||
Process
|
||||
{
|
||||
foreach ($s in $String)
|
||||
{
|
||||
switch ($PSCmdlet.ParameterSetName)
|
||||
{
|
||||
"Control" {$s | Remove-ControlCharacter}
|
||||
"Extended" {$s | Remove-ExtendedCharacter}
|
||||
Default {$s | Remove-ExtendedCharacter | Remove-ControlCharacter}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
$test = "$([char]9)Français."
|
||||
|
||||
"Original string : `"$test`""
|
||||
"Control characters stripped : `"$($test | Remove-Character -Control)`""
|
||||
"Extended characters stripped : `"$($test | Remove-Character -Extended)`""
|
||||
"Control & extended stripped : `"$($test | Remove-Character)`""
|
||||
|
|
@ -1 +0,0 @@
|
|||
"Français", "Čeština" | Remove-Character -Extended
|
||||
Loading…
Add table
Add a link
Reference in a new issue