Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
ArgumentError: comparison of Fixnum with String failed : sort « Array « Ruby
Ruby
Array
sort
ArgumentError: comparison of Fixnum with String failed
[1, 2, 3,
"a"
,
"b"
,
"c"
].sort
Related examples in the same category
1.
apply the sort (or sort!, for in-place changes)
2.
Get the top 5 elements
3.
Get the bottom 5 elements
4.
Sort object array by object attribute