Count occurrences of a substring: Difference between revisions
Content added Content deleted
(→{{header|MiniScript}}: refactored to use a function) |
|||
Line 1,474: | Line 1,474: | ||
=={{header|MiniScript}}== |
=={{header|MiniScript}}== |
||
<lang MiniScript> |
<lang MiniScript>string.count = function(s) |
||
⚫ | |||
end function |
|||
⚫ | |||
⚫ | |||
⚫ | |||
string = "ababababab" |
|||
print |
print "ababababab".count("abab")</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |