Palindrome detection: Difference between revisions

(Add APL entry)
Line 3,195:
$CharArray = $Text.ToCharArray()
[Array]::Reverse($CharArray)
$Text -likeeq (-[string]::join('', $CharArray)
}
</lang>
 
===PowerShell (Regex Version)===
This version is much faster because it does not manipulate arrays. [This is not clear; the above version was slowed down by using -join instead of [string]::join, and -like instead of -eq. After changing those it is similar, if not faster, than this version].
<lang PowerShell>
function Test-Palindrome
Anonymous user