str.slice!(fixnum) â fixnum or nil
str.slice!(fixnum, fixnum) â new_str or nil
str.slice!(range) â new_str or nil
str.slice!(regexp) â new_str or nil
str.slice!(other_str) â new_str or nil
str.slice!(fixnum, fixnum) â new_str or nil
str.slice!(range) â new_str or nil
str.slice!(regexp) â new_str or nil
str.slice!(other_str) â new_str or nil
Instance Public methods
Deletes the specified portion from str, and returns the portion deleted.
string = "this is a string" string.slice!(2) #=> "i" string.slice!(3..6) #=> " is " string.slice!(/s.*t/) #=> "sa st" string.slice!("r") #=> "r" string #=> "thing"
Please login to continue.