관리-도구
편집 파일: slice%21-i.yaml
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: "Deletes the element(s) given by an index (optionally with a length) or by a range. Returns the deleted object, subarray, or <tt>nil</tt> if the index is out of range. Equivalent to:" - !ruby/struct:SM::Flow::VERB body: " def slice!(*args)\n result = self[*args]\n self[*args] = nil\n result\n end\n\n a = [ "a", "b", "c" ]\n a.slice!(1) #=> "b"\n a #=> ["a", "c"]\n a.slice!(-1) #=> "c"\n a #=> ["a"]\n a.slice!(100) #=> nil\n a #=> ["a"]\n" full_name: Array#slice! is_singleton: false name: slice! params: | array.slice!(index) -> obj or nil array.slice!(start, length) -> sub_array or nil array.slice!(range) -> sub_array or nil visibility: public