Is there some way to use IComparer with ArrayList.Sort() to sort a group of strings as ints?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
If they are all strings, why are you using an ArrayList? If you're on .Net 2.0 or later,
List<string>
is a much better choice.If you're on .Net 3.5 or later:
A slight variation based on Joel's solution
Sure. Just create the appropriate comparer that does the conversion.