Search code examples
javaandroidjsonstringdouble-quotes

how to pass text by adding double quotes before and after in android


I want to pass some text by adding double quotes before and after.

I have a retrieved some text(url) from my json array like https://xyzabc and i have stored it in a string.

now i have to add some certificate and some response to that url and trying to retrieve some another data from it(new URL).

Here Iam trying to pass like String newUrl = oldurl+response+certificate

And i have to pass the url in double quotes(must in double quotes) if iam passing like String newUrl = "oldurl+response+certificate", the total is considering as one string so i have to append double quotes before and after the newUrl string without make it as a single String.

I have tried some "\"newUrl""\ but it doent work for me...Suggest me some solution.


Solution

  • Try this:

    newUrl = "\""+oldurl+response+certificate+"\"";
    

    Hope it helps:)