String  split (String regex):This method splits the invoking string into substrings at each match for a specified regular expression regex and returns a reference to an array of substrings. For example, consider the statements.
String str = “Hello Java”;
String s = str.split(“”);
The first statement defines the string to be analyzed. The second statement calls the split () method for the str object to decompose the string. The regular expression includes the delimiterspace so it will return a reference to array of strings where s contains Welcome, s contains toand s contains Java.
public class StringSplit
public static void main(String args)
String str3 = "Where there is a Will , there is a way";
String str = str3.split(" ");
System.out.println("str[" + i + "] : " + str[i]);