views:

54

answers:

1

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:

  1. I would

  2. surely

  3. like to

  4. go to school

  5. .

+3  A: 

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("\"");
Konrad Rudolph
Thank you very much. It was quotation mark and that was exactly what i needed.Thanks again.
Stole