I can find first position of string \"ATG\" in myString \"ATGGACGTGAGCTGATCGATGGCTGAAATGAAAA\" (i.e. index range is 0..<3) by using code below. Question is how to find al
That makes sense, because according to the docs, rangeOfString:
Finds and returns the range of the first occurrence of a given string within the receiver.
If you'd like to find all the occurrences, you could loop until rangeOfString: returns nil, and each time—trim the string up to just after the matched range. You'd have to keep track of your position within the original string and transpose the indexes, of course.