The String class has a split() method, that will return a String array.
Example 1:
public class StringSplit {
public static void main(String args[]) throws Exception{
new StringSplit().doit();
}
public void doit() {
String s3 = “Real-How-To”;
String [] temp = null;
temp = s3.split(“-”);
dump(temp);
}
public void dump(String []s) {
System.out.println(“————”);
for (int i = 0 [...]


