I am being fed a string that looks like:
"lang":"fr","fizz":"1","buzz":"Thank you so much."
The real string is much long but follows this pattern of comma-delimited "key":"value" pairs. I would like to strip out all the double-quotes around the keys, and I would like to replace the double-quotes surrounding alll the values with single-quotes, so that my string will look like this:
lang:'fr',fizz:'1',buzz:'Thank you so much.'
My best attempt:
kvString = kvString.replaceAll("\"*\":", "*:");
kvString = kvString.replaceAll(":\"*\"", ":'*'");
System.out.println(kvString);
When I run this I get kvString looking like:
"lang*:'*'fr","fizz*:'*1","buzz*:'*Thank you so much."
Can anybody spot where I'm going wrong? Thanks in advance.