You are correct - the issue is that you implemented IComparer(Of String)
, but not IComparer
, which is a completely different interface.
If you switch to use a List(Of String)
instead of ArrayList
, it will work correctly.
This will also give you type safety within your collection.
In general, ArrayList
(and the other System.Collections
types) should be avoided in new development.