Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Haskell, how do you check whether a string is a substring of another?

Tags:

string

haskell

I'm using Data.Text and all I could find are find, which only takes a Char as predicate, and breakOn, which would allow me to do what I want but seems overkill. Surely there must be a better way?

I'd be interested in the answer to the same question with other string libraries as well (String, ByteString, etc.).

like image 528
static_rtti Avatar asked Oct 22 '25 04:10

static_rtti


1 Answers

Just found it, the answer is isInfixOf.

like image 106
static_rtti Avatar answered Oct 25 '25 00:10

static_rtti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!