Having the array "a" I want to look for a pair of values within array "a". "02" followed by "10" and if found, I want to create 2 new arrays, one beginning in "02", "10" and the other beginning 3 positions after "02", "10".
a = ["11", "45", "01", "01", "02", "00", "10", "4C", "02", "10", "00", "42", "00", "00", "26"]
If I look the index of 02 and 10 individually I get 4 and 6 respectively, but index of the pair "02", "10" is 8.
irb(main)> a.index("02")
=> 4
irb(main)> a.index("10")
=> 6
The desired output would be like this:
b = ["02", "10", "00", "42", "00", "00", "26"]
c = ["00", "00", "26"]
How can I do this?