|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem With StringTokenizer
I am in the middle of a project in which I have been heavily relying on the StringTokenizer function. However, I have come across an area where I need to be able to scan the next token w/o removing it from the StringTokenizer. Alternatively, I could just as well use a function that can reinsert a token into the head of the StringTokenizer. Does anyone know how to do either function? I looked on Sun's java site, but there was no help there. Thanks so much.
|
|
#2
|
|||
|
|||
|
I don't know if theres a 'peek' type function available for the StringTokenizer but you could extend it and add one either by directly extending the class or more likely simulating it by getting the next token into a temporary variable and consulting with that instead of getting a new token each time.
Hope this helps, -KM- |
|
#3
|
|||
|
|||
|
i am not sure if it is possible, since i have only used StringTokenizer in conjunction with a school-project, and last i looked at it, the java-docs recommends using the String-class instead. would it be too much trouble converting the program to utilize that class instead?
__________________
Benjamin Horsleben horsleben.com/benjamin Don't blame malice for what stupidity can explain |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Problem With StringTokenizer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|