简体   繁体   中英

how to convert a string[] to json

I declared an array as below

String[] finalcodes = new String[50] ;

and assigning some values to it finally when I print finalcodes it results as below.

["aaa","bbb","ccc"]

but my requirement is to get it as a json object

so please suggest me how to convert my string array to JSON Object.

You can use jackson library also check your json is valid; http://jackson.codehaus.org/ / http://jsonformatter.curiousconcept.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM