Avatar of Rohit Bajaj
Rohit Bajaj
Flag for India asked on

Possible ways of creating json string dynamicaly

HI,
Currently in my code i am creating a json string like :
        String json = "{\"text\" : \""+text+"\"}";

Open in new window

For just this small json i dont want to include any library like Gson or....etc...

what are the possible ways in which i can make the above json...probably avoiding these quotes as much as possible and using a variable in between as it is error prone.

Thanks
Java

Avatar of undefined
Last Comment
gurpsbassi

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
gurpsbassi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy