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.
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:
array=g array=ksforg array=ks
array=Bharat array= Veer Portal
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.