import java.util.StringTokenizer;
class showToken {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
StringTokenizer stringOne;
String myBirthdayMonth, myBirthdayDate, myBirthdayYear;
String quoteOne = "01/22/2010/";
stringOne = new StringTokenizer(quoteOne, "/");
myBirthdayMonth = stringOne.nextToken();
myBirthdayDate = stringOne.nextToken();
myBirthdayYear = stringOne.nextToken();
System.out.println("My Birthday Month: " + myBirthdayMonth);
System.out.println("My Birthday Date: " + myBirthdayDate);
System.out.println("My Birthday Year: " + myBirthdayYear);
}
}
No comments:
Post a Comment