Split string into individual words Java

后端 未结 12 1292
既然无缘
既然无缘 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:46

    you can use Apache commons' StringUtils class

        String[] partsOfString = StringUtils.split("I want to walk my dog",StringUtils.SPACE)
    

提交回复
热议问题