Given string and delimiter and we have to separate the given string in substrings.
1) String [] split (String delimiter)
This function returns array of strings, separated by delimiter (which is a string, passing as a delimiter).
2) String [] split (String delimiter, int max)
Here,
String[] - array of strings (substrings separated by given delimiter).
String delimiter - string as delimiter to split string.
int max - controls the number of substrings separated through given delimiter.
Consider the program:
Output