This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
1[1003] 2[03] 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
SCJP 1.2
SCBCD 1.3 Beta
SCWCD 1.4 Beta
SCMAD Beta
SCDJWS Beta
KS
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
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: