uprichard
Programmer
- May 2, 2002
- 16
I have a large string (upto 900,000 characters). I need to search it for a given pattern i.e. "The dog sat on the mat" and then work with each part of the string. The string search string can appear in multiple places and I will need to get each sub section of the string.
I thought of using split, but that will not return the string that was searched as part of the returned values. I guess I could add it back by hand.
Is there a better way than using split? Is there a way to return the offset within the string that the pattern starts or ends at?
thanks,
I thought of using split, but that will not return the string that was searched as part of the returned values. I guess I could add it back by hand.
Is there a better way than using split? Is there a way to return the offset within the string that the pattern starts or ends at?
thanks,