user1688181
user1688181

Reputation: 492

Convert String into String array

I have this String from a JSON value:

["1","5","10","15","20"]

I need to get a string array from this string. How do I do that?

Upvotes: 2

Views: 292

Answers (1)

anubhava
anubhava

Reputation: 786146

You can use gson library like this:

Gson gson = new Gson(); // create gson instance

String[] strArr = gson.fromJson(jsonString, String[].class);

Upvotes: 7

Related Questions