/**/ /*
* You only need
In http://ostermiller.org/utils/stringtokenizer.java.html
Public class stringtokenizer implements java. util. enumeration, java. util. iterator {
Simplified
Public class stringtokenizer implements java. util. Enumeration {
.
You can use it in the MIDlet immediately.
String S = "(AAA \ t * (B + C1 ))";
Stringtokenizer ST = new stringtokenizer (S, "\ t \ n \ r \ f", "() + *");
While (St. hasmoretokens ()){
System. Out. println (St. nexttoken ());
After the actual test, the following results are obtained:
(
Aaa
*
(
B
+
C1
)
)
*/
String s = " (AAA \ t * (B + C1 )) " ;
Stringtokenizer St = New Stringtokenizer (S, " \ T \ n \ r \ f " , " () + * " );
While (St. hasmoretokens ()) {
System. Out. println (St. nexttoken ());
ostermiller version of stringtokenizer, Source Code can be downloaded from ostermiller utils version 1.05.00.