split(CharSequence) method of a
Pattern class used to splits the given char sequence passed as parameter to method around matches of this pattern.This method can split charSequence into an array of String's, using the regular expression used to compile the pattern as a delimiter.so we can say that the method returns the array of strings computed by splitting the input around matches of this pattern.
Syntax:
public String[] split(CharSequence input)
Parameters: This method accepts a single parameter
input which represents character sequence to be split.
Return value: This method returns the array of strings computed by splitting the input around matches of this pattern.
Below programs illustrate the split(CharSequence) method:
Program 1:
Output:
array[0]=g
array[1]=ksforg
array[2]=ks
Program 2: