This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
1 2 3[suggestion1] Process Exit... -------- question -------- how do i get an array of tokens ? i do not want the $ sign the token may not be there !in that case array element should be null and see the delim "$a" , it seems a is ignored ! what if i have delim of two chars or more ?? --kalpesh
Test 094, IBM WID 6.0 cert
SCBCD 1.3 Beta
SCWCD 1.4 Beta
Hi Kalpesh, In your first example the letter a is not being ignored. You don't have any 'a' characters in your original string (temp). The characters inside the delimiter string are considered separately and not in a group (i.e., treated as an array of chars instead of string). StringTokenizer has not been implemented to return empty tokens. If you require that then you must write your own tokenizer that does that. If you want an array of tokens you can just do the following: