I want to extract a series of Needles (Sub-Strings) from a Haystack (String). I will always extract the Needles in ascending order of appearence within the Haystack. When I previously did such a task using VBA I was able to work with the same "Original" string, beginning the search for each new needle only from a chosen character of the string (to use a book analogy...the search for Needle1 would begin on page 1, but by the time I was searching for Needle10 I may only be starting the search on page 25).
So far I can only find AnsiPos which begins each search from character 1 of the string. Does this mean I effectively have to search for Needle1 then chop it (and all characters that precede it) off the beginning of the string before beginning my search for Needle2 (thus the search, as in the VBA example, will now only be searching from the characters immediately following the last found needle)? Or is there a better way?
So far I can only find AnsiPos which begins each search from character 1 of the string. Does this mean I effectively have to search for Needle1 then chop it (and all characters that precede it) off the beginning of the string before beginning my search for Needle2 (thus the search, as in the VBA example, will now only be searching from the characters immediately following the last found needle)? Or is there a better way?