String matching: Difference between revisions

m
→‎{{header|Sidef}}: fixed the while loop
m (→‎{{header|Sidef}}: fixed the while loop)
Line 2,408:
 
# Find multiple occurrences of a string
while (var(pos=-1) = first.index(second, pos+1) != -1) {;
while (pos = first.index(second, pos+1) != -1) {
say "Match at pos: #{pos}";
}</lang>
2,756

edits