Reputation: 13173
I have a strings like:
{ "_id" : ObjectId( "4ebb9544e4b097b7e6617e1c" ), "_class" :
I need a strings like:
{ "_id" : "4ebb9544e4b097b7e6617e1c", "_class" :
How to make this conversion in java?
Upvotes: 0
Views: 78
Reputation: 183602
If you really know the exact form of the string, and the object-ID will always be hex like that, you can just do:
s = s.replaceAll("ObjectId\\( ([^)]+) \\)", "$1");
Upvotes: 1