string.split() javas code example
Example 1: java split string
String yourString = "Hello/Test/World";
String[] strings = yourString.split("/" /*<- Regex */);
Output:
strings = [Hello, Test, World]
Example 2: string split method
var str = "How are you doing today?";
var res = str.split(" ", 3);