How to retrieve json key pair value of desc which is not json array?

for (int i = 0; i < jArray.length(); i++) {   
  JSONObject item_data = jArray.getJSONObject(i);
  String nameval=item_data.getString("name");  
  String descrip=item_data.getString("desc");}

where desc

{"0":"No Pain","1":"Mild","2":"Medium","3":"high","4":"Severe","5":"Critical"} 

how can i get these values in string?

Answers


You need to treat the desc element as a JSONObject:

JSONObject  desc = item_data.getJSONObject("desc");
String elem0 = desc.getString("0");

Need Your Help

Hiding exec output in a SQL Server 2008 stored procedure

sql sql-server ssis exec output

We have clients running SQL Server 2008 RC up to SQL Server 2014 and the application is so far version agnostic.

Style datagrid table - Top left corner

c# wpf coding-style datagrid

I am styling a datatable but I can't figure out how to style the top left filed of the datagrid. It is the gray field in this picture:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.