Skip to content
Advertisement

Split a String with delimiter – , (comma) and double quotes over every value in java

I have a String value as – [“My, fancy, text”, “My, other, value”]

I want to get the output as a List with elements as –

JavaScript

The enclosing bracketts are to be removed.It may happen that enclosing bracketts ‘[‘ and ‘]’ are not present. ‘

Advertisement

Answer

Assuming the requirement is to remove all the square brackets and finding text between double quotes as individual string. Below Code might help

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement