Anonymous user
Count occurrences of a substring: Difference between revisions
→{{header|Tcl}}: Demonstrate the lack of re-metachar problems
(→Tcl: Added implementation) |
(→{{header|Tcl}}: Demonstrate the lack of re-metachar problems) |
||
Line 33:
}
puts [countSubstrings "the three truths" "th"]
puts [countSubstrings "ababababab" "abab"]
puts [countSubstrings "abaabba*bbaba*bbab" "a*b"]</lang>
Output:<pre>3
2
2</pre>
|