To avoid indexing all together and save a substantial amount of time and RAM, I need a program that can:
- Find the Xth occurrence of a string in another (which inString can't do unless you put it in a for loop and that takes a very long time to have to do this every single word).
- Return the number of occurrences of the string that was found in the "haystack."
How it would work:
X = -1: Return the number of occurrences of Ans in Str1.
X >= 0: Would return the location of the Xth occurrence of Ans in Str1.
If the Ans was not found in Str1, then zero would be returned.
Examples:
Code: Select all
"WILL YOU FIND ME? CAN YOU FIND ME? WHEN WILL YOU FIND ME?->Str1
-1->X
"FIND ME
Asm(prgmFIND
Code: Select all
"WILL YOU FIND ME? CAN YOU FIND ME? WHEN WILL YOU FIND ME?->Str1
0->X
"FIND ME
Asm(prgmFIND
Code: Select all
"WILL YOU FIND ME? CAN YOU FIND ME? WHEN WILL YOU FIND ME?->Str1
1->X
"FIND ME
Asm(prgmFIND