For this, we use split() function in JAVA. Suppose you have a
String a="I am hello";
If you want to store String a as a 3 element array with the elements, "I","am" and "hello", you simply use:
String arr[] = a.split(" ");
This would create an array that is much easier to operate upon.