
17 Oct
2004
17 Oct
'04
3:40 p.m.
Peter Stranney wrote:
isSubStrand:: String -> String -> Bool isSubStrand [] [] = True isSubStrand [] (y:ys) = False isSubStrand (x:xs) [] = False isSubStrand (x:xs) (y:ys) | length(x:xs)>length(y:ys) = False | take (length (x:xs)) (y:ys)==(x:xs) = True | otherwise = isSubStrand (x:xs) ys
Just to muddy the water a bit. . . What happens if the second string is infinite? Sam