I have a string which stores webservice response as below. In this string I want to remove the whitespace next to the double quotes(opening & closing" using java.
String WebserviceResponse;
{
"assessmentID": 289,
"assesmentName": " OneCert ",
"accountName": " spadmin ",
"assetName": " OneCert ",
"applicationName": " OneCert ",
"accountType": " LocalAccount ",
"environment": " Test "
},
{
"assessmentID": 289,
"assesmentName": "OneCert ",
"accountName": "9000032",
"assetName": "OneCert",
"applicationName": "OneCert ",
"accountType": "zone2.scbdev.net",
"environment": "Test"
}
I tried the below code to remove space next to double quotes String FormattedResponse= WebserviceResponse.replaceAll( "\s","" );
but it removes all the spaces. Can you please help me on this.