Anonymous user
Count occurrences of a substring: Difference between revisions
m
→{{header|Groovy}}: corrected operator name
(→{{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)
|