SplitString

public class splitstring {


public static void main(String[] args) {

String str="This is my java program";

String st[];
st=str.split(" ");
for(int i=0;i<st.length;i++)
{
System.out.println(st[i]);
}

}

}

Output:

This
is
my
java
program

No comments:

Post a Comment