There is an inbuilt method to convert a JSONObject to a String. Why don’t you use that:
JSONObject json = new JSONObject();
json.toString();
More Related Contents:
- can't input value for string?
- Java String split removed empty values
- How can I pad a String in Java?
- Read/Write String from/to a File in Android
- Comparing strings with == which are declared final in Java
- In Java, how do I check if a string contains a substring (ignoring case)? [duplicate]
- Android Split string
- How do I convert CamelCase into human-readable names in Java?
- String comparison and String interning in Java
- Simple way to count character occurrences in a string [duplicate]
- Is it better practice to use String.format over string Concatenation in Java?
- How to convert/parse from String to char in java?
- Using Locales with Java’s toLowerCase() and toUpperCase()
- How to upper case every first letter of word in a string? [duplicate]
- What is the simplest way to convert a Java string from all caps (words separated by underscores) to CamelCase (no word separators)?
- Java converting int to hex and back again
- Java String.split() Regex
- How can I invert the case of a String in Java?
- How can I start a new android activity using class name in a string?
- Remove Null Value from String array in java
- How to remove only trailing spaces of a string in Java and keep leading spaces?
- How to get address of a Java Object? [duplicate]
- Why is String.length() a method?
- Is it possible to change the text color in a string to multiple colors in Java?
- A method to reverse effect of java String.split()? [duplicate]
- Java compressing Strings
- Creating a factory method in Java that doesn’t rely on if-else
- Translating strings character by character
- Compare two hex strings in Java?
- Why does byteArray have a length of 22 instead of 20?