Longest common substring: Difference between revisions

Content added Content deleted
Line 988: Line 988:


<lang PowerShell>function lcs([String]$xs,[String]$ys) {
<lang PowerShell>function lcs([String]$xs,[String]$ys) {
if ($xs.Length -lt $ys.Length) {$ys,$xs = $xs,$ys}
if ([String]::IsNullOrEmpty($xs) -or [String]::IsNullOrEmpty($ys)) {
return ""
}
$is = $xs.ToCharArray()
$is = $xs.ToCharArray()
$js = $ys.ToCharArray()
$js = $ys.ToCharArray()