Count occurrences of a substring: Difference between revisions
Content deleted Content added
→{{header|Groovy}}: new solution |
m →{{header|Groovy}}: corrected operator name |
||
Line 281:
2</pre>
=={{header|Groovy}}==
Solution, uses the Groovy "
<lang groovy>println (('the three truths' =~ /th/).count)
println (('ababababab' =~ /abab/).count)
|