Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,12 +0,0 @@
function index($haystack,$needle) {
$index = $haystack.IndexOf($needle)
if($index -eq -1) {
Write-Warning "$needle is absent"
} else {
$index
}
}
$haystack = @("word", "phrase", "preface", "title", "house", "line", "chapter", "page", "book", "house")
index $haystack "house"
index $haystack "paragraph"

View file

@ -1,57 +0,0 @@
function Find-Needle
{
[CmdletBinding()]
[OutputType([int])]
Param
(
[Parameter(Mandatory=$true, Position=0)]
[string]
$Needle,
[Parameter(Mandatory=$true, Position=1)]
[string[]]
$Haystack,
[switch]
$LastIndex
)
if ($LastIndex)
{
$index = [Array]::LastIndexOf($Haystack,$Needle)
if ($index -eq -1)
{
Write-Verbose "Needle not found in Haystack"
return $index
}
if ((($Haystack | Group-Object | Where-Object Count -GT 1).Group).IndexOf($Needle) -ne -1)
{
Write-Verbose "Last needle found in Haystack at index $index"
}
else
{
Write-Verbose "Needle found in Haystack at index $index (No duplicates were found)"
}
return $index
}
else
{
$index = [Array]::IndexOf($Haystack,$Needle)
if ($index -eq -1)
{
Write-Verbose "Needle not found in Haystack"
}
else
{
Write-Verbose "Needle found in Haystack at index $index"
}
return $index
}
}
$haystack = @("word", "phrase", "preface", "title", "house", "line", "chapter", "page", "book", "house")

View file

@ -1 +0,0 @@
Find-Needle "house" $haystack

View file

@ -1 +0,0 @@
Find-Needle "house" $haystack -Verbose

View file

@ -1 +0,0 @@
Find-Needle "house" $haystack -LastIndex -Verbose

View file

@ -1 +0,0 @@
Find-Needle "title" $haystack -LastIndex -Verbose

View file

@ -1 +0,0 @@
Find-Needle "something" $haystack -Verbose