Add the –version option to the option parser.
Replaces the content of self
with the content of other_array
; returns self
:
a = [:foo, 'bar', 2] a.replace(['foo', :bar, 3]) # => ["foo", :bar, 3]
Replaces the contents of str with the corresponding values in other_str.
s = "hello" #=> "hello" s.replace "world" #=> "world"
Returns true if str
starts with one of the prefixes
given. Each of the prefixes
should be a String
or a Regexp
.
"hello".start_with?("hell") #=> true "hello".start_with?(/H/i) #=> true # returns true if one of the prefixes matches. "hello".start_with?("heaven", "hell") #=> true "hello".start_with?("heaven", "paradise") #=> false
Returns whether ASCII-compatible or not.
Encoding::UTF_8.ascii_compatible? #=> true Encoding::UTF_16BE.ascii_compatible? #=> false
Waits until IO
is priority and returns true
or false
when times out.
Dup internal hash.
Returns true if sym
starts with one of the prefixes
given. Each of the prefixes
should be a String
or a Regexp
.
:hello.start_with?("hell") #=> true :hello.start_with?(/H/i) #=> true # returns true if one of the prefixes matches. :hello.start_with?("heaven", "hell") #=> true :hello.start_with?("heaven", "paradise") #=> false
Duplicates a StringScanner
object.
Replaces the entire contents of self
with the contents of other_hash
; returns self
:
h = {foo: 0, bar: 1, baz: 2} h.replace({bat: 3, bam: 4}) # => {:bat=>3, :bam=>4}
Returns the Laplace expansion along given row or column.
Matrix[[7,6], [3,9]].laplace_expansion(column: 1) # => 45 Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0) # => Vector[3, -2]
Called for dup & clone.
Called for dup & clone.
Returns the number of threads waiting on the queue.
Returns the number of threads waiting on the queue.
The version of the Marshal
format for your Ruby.
How String
Gem paths should be split. Overridable for esoteric platforms.
Get a single optional argument from the command line. If more than one argument is given, return only the first. Return nil if none are given.