I'm able to remove the key from JsonObject using:
String prop = "test";
JsonObject o = parser.parse(props).getAsJsonObject();
o.remove(prop);
I need to remove all the keys matching certain pattern from the JsonObject, like anything that starts with "test.*". Instead of iterating over the keys and find a match, is there any other way to remove the keys matching a given pattern?
input: {"test":"0","test_1": "1","test_10":"10", "site":"abc.com"}
expected output: {"site":"abc.com"}
Thanks!
containsyour test string