I have a string ,

```
x = "[1,2,3]"

```

How can I get the elements 1 and 2 from the string?

I tried the strsplit but that seems a bit tricky. Then I tried splitting on "[", and that also did not seem easy.