groovy replace double quotes with single and single with double -
i have string "['type':'multipolygon', 'coordinates':[[73.31, 37.46], [74.92, 37.24]]]"
how can replace single quotes double quotes , double single? result should this: '["type":"multipolygon", "coordinates":[[73.31, 37.46], [74.92, 37.24]]]'
from link given @yate, can find method:
tr(string sourceset, string replacementset)
and apply string as:
def yourstring = ... def changedstring = yourstring.tr(/"'/,/'"/)
that job.
Comments
Post a Comment