Open
Description
This is a request to have a stdlib function for contains
. Right now, I'm using something like:
strContains(s, substr):: (
std.length(std.findSubstr(substr, s)) > 0
)
But the problem is that findSubstr
is doing a regex, so I need to be aware of that and escape, which is not always possible, if that value isn't hard-coded.
edit or at least that's how it reads from the documentation:
std.findSubstr(pat, str)
Returns an array that contains the indexes of all occurances of pat in str.
the use of pat
being short for pattern
usually meaning regex.
Is there another way to do this?