When I am fetching the response from web service in a string buffer and converting it to string, it is providing me the below string.
There are plenty of blank spaces from the given String which needs to be removed:
{                               'GetPolicyResp' : {                         'VersionID': '1.0'                      ,'TransactionID': 'urn:uuid:ea2051c5-c1b1-44cd-bcae-a4a06079e2bd'                        ,'Status' : {                      'StatusCode': '0'                       ,'Detail': 'Success'                             }                      ,'Path': '1'                        ,'RequestReceivedDate': '2015-04-23'                        , 'healthPolicy':{                                'classifications': 'AWH'                        ,'primaryPolicyType': 'Medical'                                          }                           ,'primaryNetworkCategory':{                                            'code': 'ACOCTXM4'                          ,'description': 'Aetna Whole Health - Memorial Hermann Accountable Care Network'                                               }                                                                              }               }"
I need to remove the blank space from the above string to get a perfect json response.
P.S. I have tried trim and replaceAll but was of no help.
 
    