Split string into individual words Java

后端 未结 12 1268
既然无缘
既然无缘 2020-12-02 13:19

I would like to know how to split up a large string into a series of smaller strings or words. For example:

I want to walk my dog.

12条回答
  •  独厮守ぢ
    2020-12-02 13:49

    See my other answer if your phrase contains accentuated characters :

    String[] listeMots = phrase.split("\\P{L}+");
    

提交回复
热议问题