Question: I am having string:

```
str = "[[591, 184] , [741, 910] , [987,512], [2974, 174]]"

```

I want to convert this to an array:

```
arr = [[591, 184] , [741, 910] , [987,512], [2974, 174]]

```

How can i do this?

Answer: 
A JSON parser ought to work fine:

```
require "json"

str = "[[591, 184] , [741, 910] , [987,512], [2974, 174]]"
p JSON.parse(str)
# => [[591, 184], [741, 910], [987,512], [2974, 174]]

```

Try it on eval.in: <https://eval.in/777054>
You have to use "eval":

```
> str = "[[591, 184] , [741, 910] , [987,512], [2974, 174]]"
# => "[[591, 184] , [741, 910] , [987,512], [2974, 174]]"
> arr = eval str
# => [[591, 184], [741, 910], [987, 512], [2974, 174]] 

```