A
_Andy_
Thx Andy, Good thinking. However in my implementation this algorithm could
lead to false positive:
Source: 1 1 3 3 -> Double 1 1 3 3 1 1 3 3
Compare: 3 3 1 1
IndexOf(3 3 1 1) <> -1
You've tried that twice?! Surely you can _see_ "3311" in your double
string!
Look, here it is ---------------v
Source: 1 1 3 3 -> Double 1 1 3 3 1 1 3 3
Compare: 3 3 1 1
IndexOf(3 3 1 1) <> -1
"3311" is a rotation of "1133" by order 2.
i.e.
3311 (order 0)
3113 (order 1)
1133 (order 2)
1331 (order 3)
Dim s As String = "11331133"
Debug.WriteLine( s.IndexOf( "3311" ) )
If that says anything other than "2" I suggest you have typed it
incorrectly! Either that or I am surrounded by madness...

Rgds,