[Haskell-cafe] String search algorithms
Henning Thielemann
lemming at henning-thielemann.de
Mon Apr 25 06:18:31 EDT 2005
On Mon, 25 Apr 2005, Bayley, Alistair wrote:
> I'm a bit puzzled to find no sub-string search in the Haskell libraries
> (unless there's some neat composition of the existing Data.List functions
> that I've missed). Google doesn't help much either. I've found a KMP
> implementation:
> http://haskell.org/hawiki/RunTimeCompilation
>
> I'm after something that'll report the position of the first occurrence,
> like Java's String.indexOf().
List.findIndex (List.isPrefixOf "bla") (List.tails "dfvbdbblaesre")
More information about the Haskell-Cafe
mailing list