How to split a sentence into two parts

后端 未结 5 1308
半阙折子戏
半阙折子戏 2021-01-21 20:29

How to split a sentence into two parts in JAVA? If there is the following

String sentence = \"I love Java <=> I love Python\"

How can I

5条回答
  •  失恋的感觉
    2021-01-21 21:00

    public String[] changeSentence(String line){
    String[] substrings = line.split("<=>");
    return substrings;
    }

提交回复
热议问题