Question: I am getting a list from the json response that I want to convert to strings.

```
String fruits = remoteMessage.getData().get("fruits");

```

The above line gives me the following response,

```
["California Apple","Mango","Mexico Original Banana"]

```

Now, what I need is,

```
"California Apple", "Mango", "Mexico Original Banana"

```

How could this be achieved?

Answer: 
With the Arrays.asList () utility method you can do what you want.
Note only works with primitive data types.

```
List<String> list = Arrays.asList(fruits);

```

;)
### Delete First and Last character using `StringBuffer`

```
String fruits = remoteMessage.getData().get("fruits"); 
StringBuffer sb=new StringBuffer(fruits);
sb.deleteCharAt(0);
sb.deleteCharAt(sb.length()-1);
fruits = sb.toString();

```

### Output

```
 "California Apple", "Mango", "Mexico Original Banana"

```