RosettaCodeData/Task/Substring/Haskell/substring.hs
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

3 lines
114 B
Haskell

t45 n c s | null sub = []
| otherwise = take n. head $ sub
where sub = filter(isPrefixOf c) $ tails s