String manipulation in Ruby is very advanced. With the `[]` method or its alias `slice`, it's easy to extract a complex part!
Via indexes.
Via a String.
Via a Regex.
The slice!
method also deletes the selected part.
The []=
method replaces the selected part.
Link to Ruby documentation for slice.
💡The method definition is slice(*args)
, do you recognize the splat operator used to handle the variable number of arguments?