Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 189

StringContainsQ And

$
0
0

I'm looking to test whether a string contains all substrings in it, independent of each substrings location.For example:

StringContainsQ[{"abcd", "cdab", "acdb", "abdc"}, "ab" ~~ ___ ~~ "cd"]

Results in:

{True, False, False, False}

But what I'm looking for would be:

{True, True, False, False}

However, something like:

StringContainsQ[{"abcd", "cdab", "acdb", "abdc"}, "ab"&&"cd"]

Results in errors. Any suggestions?


Viewing all articles
Browse latest Browse all 189

Latest Images

Trending Articles



Latest Images