A quick snippet to grab all the indexes of a substring within a string:

proto (JS/AS2):

non-polluting:

AS3:

PHP :

Another use would be to get the n-th index of a substring, just using array access…