To return the substring using an index, we can do this like so

```
string = "hello"
string[0] returns "h"
string[1] returns "e"
(and so on...)

```

Let's say I had an array [1,2,3,4] and a string "awesome". How would I return the relevant substring(s) from the array?

```
[1,2,3,4] should return "weso"

```

This is because I have a method which is meant to return the substring after every "r" and it is failing:

You can see that I have found the indexes for every substring "r" and it is returned as an array. The line below is incrementing each value in the array by +1.

I now need to return the substrings from the string by the relevant indexes from the array. 

```
def pirates_say_arrrrrrrrr(string)

  all_index = (0 ... string.length).find_all {|i| string[i] ==  "r"}
  y = all_index.map do |i| i + 1
  end
  string[y.first..y.last]
end

# pirates_say_arrrrrrrrr("are you really learning Ruby?") # => "eenu"
# pirates_say_arrrrrrrrr("Katy Perry is on the radio!")   # => "rya"

```