CDL.rowToString(jsonArray)
method returns a comma separated string from JSONArray.
JSONArray
jsonArray = new JSONArray();
jsonArray.put("Chess");
jsonArray.put("Tennis");
jsonArray.put("Cricket");
jsonArray.put("Football");
String str
= CDL.rowToString(jsonArray);
App.java
package com.sample; import org.json.CDL; import org.json.JSONArray; public class App { public static void main(String args[]) { JSONArray jsonArray = new JSONArray(); jsonArray.put("Chess"); jsonArray.put("Tennis"); jsonArray.put("Cricket"); jsonArray.put("Football"); String str = CDL.rowToString(jsonArray); System.out.println(str); } }
Output
Chess,Tennis,Cricket,Football
No comments:
Post a Comment