在引号上划分/拆分字符串

Sto*_*ole 3 java string split character

我有以下字符串:

我肯定会"喜欢上学".

现在,我想将这个字符串拆分为省略号,这是我想获得以下输出:

  1. 我会

  2. 一定

  3. 喜欢

  4. 上学

  5. .

Kon*_*lph 6

我的情况你的意思是引号(")而不是省略号,最简单的解决方案是使用String.split:

String text = "I would \"surely\" like to \"go to school\".";
String[] result = text.split("\"");
Run Code Online (Sandbox Code Playgroud)