/ Published in: Ruby

This method generates random (and printable) ascii characters.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
require 'enumerator' def random_string(length=10, s="") length.enum_for(:times).inject(s) do |result, index| s << rand(93) + 33 end end
Comments
