   [java] StringTokenizer issue
  I have a question related to StringTokenizer.I'm using the code below to retrieve a line from a file.StringTokenizer token = new StringTokenizer(element, "*");The line is as belowed.RMR*CR*00101539**0.01I'm expecting the retrieved token.count to be 5 with an empty token between **.  However, the output is 4 with tokenToken1 = RMRToken2 = CRToken3 = 00101539Token4 = 0.01Is there anything I can retrieve the empty token as well?   
  using element.split("*") should work.   ;  The problem is, that the StringTokenizer does not deliver empty elements. There are some other Tokenizer implementation if you google for such. Otherwise iterate over the String yourself and attend the empty elements.   ;Quote:Original post by Japhethusing element.split("*") should work.Yes and no.  Yes, the split method will work, but for this example,I get the following error...Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0*Because the example string uses the * quantifier, you should do this...element.split("\\*");Every time I am trying to split a file name with '.' I have the same problem.