App inventor 2: How to split at spaces

后端 未结 3 648
余生分开走
余生分开走 2021-01-23 07:10

I have a small question. I want to split the text at the space.

eg:

\"Hello World \"

should be

\"Hel

3条回答
  •  醉酒成梦
    2021-01-23 07:27

    You can use String.split()

    String yourString = "Hello World";
    
    String[] result = yourString.split(" ");
    result[0]; //"Hello"
    result[1]; //"World"
    

提交回复
热议问题