I have the following string:
I would "surely" like to "go to school".
Now, I would like to split this string at the ellipses, that is i would like to get the following output:
I would
surely
like to
go to school
.
I have the following string:
I would "surely" like to "go to school".
Now, I would like to split this string at the ellipses, that is i would like to get the following output:
I would
surely
like to
go to school
.
I case you meant quotation mark ("
) instead of ellipsis, the easiest solution is to use String.split
:
String text = "I would \"surely\" like to \"go to school\".";
String[] result = text.split("\"");