String#ord in Ruby 1.8? Here's a simple monkey-patch that will add it to Ruby.unless "".respond_to?(:ord)
class String
def ord
self[0].ord
end
end
end
http://gist.github.com/251465
String#ord in Ruby 1.8? Here's a simple monkey-patch that will add it to Ruby.unless "".respond_to?(:ord)
class String
def ord
self[0].ord
end
end
end
0 comments:
Post a Comment