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

StringContainsQ, but anywhere in order

$
0
0

I am trying to find a string within a string, but "anywhere", so long as it is in the right order.

For example

StringContainsQ["aabbc","ac"]

returns

False

but I want True, since ac does in fact occur interleaved as position 1 and then position 5 in aabbc, as well as at position 2 and then position 5.

Anywhere, but in the right order. So

For example

NewStringContainsQFunction["aabbc","ba"]

should return.

False

Is there a nice way to do this, apart from searching letter by letter, until the string is built?


Viewing all articles
Browse latest Browse all 189

Trending Articles