I'm not sure if there is a simple way of doing this, but is there a way to find multiple instances in an unknown string? For example:
hellohellohellobyebyebyehello
Without knowing the value of the above string, can I return something that will tell me that there are 3 instances of "hello" and 3 instances of "bye" (I'm not worried about the last hello however as I'm looking for consecutive repetition. Thanks in advance!