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

StringCount in Mathematica

$
0
0
StringCount["one letters three letters letters one letters letters three letters","one" ~~ __ ~~ "three"]

gives

1

because there is the one occurence of "one [letters three letters letters one letters letters] three [letters]"

It took me some time to understand that Mathematica "thinks" in this way because I expected the value

2

due to "one letters three letters letters one letters letters three letters"

Now I am facing the problem of finding the code that solves this problem in my desired way.


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>