/**
*
*/
/**
*
*
*/
public class Splitstring {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String s = new String("This is Sai from Bangalore");
String a[] = s.split(" ");
for(int i=0;i<5;i++){
System.out.println(a[i]);
}
}
}
*
*/
/**
*
*
*/
public class Splitstring {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String s = new String("This is Sai from Bangalore");
String a[] = s.split(" ");
for(int i=0;i<5;i++){
System.out.println(a[i]);
}
}
}
Output:-
This
is
Sai
from
Bangalore
No comments:
Post a Comment