Harold Hausman
3/25/2007 9:29:00 AM
On 3/25/07, Une Bévue <unbewusst.sein@wortanschahung.com.invalid> wrote:
> Ok, fine thanks a lot !
>
> does the method :
> String.to_a doing :
>
> s="a string"
> sa=s.to_a
> #=> ['a',' ','s','t','r','i','n','g']
>
> exists allready ?
>
irb(main):001:0> "a string".split( "" )
=> ["a", " ", "s", "t", "r", "i", "n", "g"]
> generally speaking how to list-out, for a given class all the methods ?
>
irb(main):002:0> "a string".methods.sort
=> ["%", "*", "+", "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", "[]", "
[]=", "__id__", "__send__", "all?", "any?", "between?", "capitalize", "capitaliz
e!", "casecmp", "center", "chomp", "chomp!", "chop", "chop!", "class", "clone",
"collect", "concat", "count", "crypt", "delete", "delete!", "detect", "display",
"downcase", "downcase!", "dump", "dup", "each", "each_byte", "each_line", "each
_with_index", "empty?", "entries", "eql?", "equal?", "extend", "find", "find_all
", "freeze", "frozen?", "gem", "grep", "gsub", "gsub!", "hash", "hex", "id", "in
clude?", "index", "inject", "insert", "inspect", "instance_eval", "instance_of?"
, "instance_variable_defined?", "instance_variable_get", "instance_variable_set"
, "instance_variables", "intern", "is_a?", "is_binary_data?", "is_complex_yaml?"
, "kind_of?", "length", "ljust", "lstrip", "lstrip!", "map", "match", "max", "me
mber?", "method", "methods", "min", "next", "next!", "nil?", "object_id", "oct",
"partition", "private_methods", "protected_methods", "public_methods", "reject"
, "replace", "require", "require_gem", "respond_to?", "reverse", "reverse!", "ri
ndex", "rjust", "rstrip", "rstrip!", "scan", "select", "send", "singleton_method
s", "size", "slice", "slice!", "sort", "sort_by", "split", "squeeze", "squeeze!"
, "strip", "strip!", "sub", "sub!", "succ", "succ!", "sum", "swapcase", "swapcas
e!", "taguri", "taguri=", "taint", "tainted?", "to_a", "to_f", "to_i", "to_s", "
to_str", "to_sym", "to_yaml", "to_yaml_properties", "to_yaml_style", "tr", "tr!"
, "tr_s", "tr_s!", "type", "unpack", "untaint", "upcase", "upcase!", "upto", "zi
p"]
;)
Hope that helps,
-Harold