A StringTokenizer parses up a String into Tokens using a delimiter(sp?). So if you had the string "Hello|okay|alright" and you wanted the | to be a delimiter then you'd create a StringTokenizer, the syntax would be:
String theString = new String("Hello|okay|alright"
StringTokenizer theTokenizer = new StringTokenizer(theString, "|"
If you give no delimiter, by default a space counts as a delimiter, you could parse a Date String using the default I would think. But I would also look at the GregorianCalendar Class if you're wanting to extract compotents of a Date.
So if my string containing a date "21/05/02", I would want the delimeter in this case to be "/". I want the user to input the date though? Then I want to convert the day, month and year into int values to display. What would the class for this look like?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.