[Solved] How to obtain parts of a string [closed]
You can use split() and split according to whitespace(s). String str = “add John Do 123-456-789”; String[] res = str.split(“\\s+”); System.out.println(Arrays.toString(res)); Now the result will be: [add, John, Do, 123-456-789] Now you can obtain the string values from res array. As stated in the comments, I suggest you to do a little research before posting … Read more