aspose file tools*
The moose likes Java in General and the fly likes Use of String Tokeniser to get data after second occurrence of Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Use of String Tokeniser to get data after second occurrence of "_"" Watch "Use of String Tokeniser to get data after second occurrence of "_"" New topic
Author

Use of String Tokeniser to get data after second occurrence of "_"

pendse anagha
Ranch Hand

Joined: Mar 09, 2005
Posts: 44
Hello ,
Could someone point me to how I could get data that exists after the second
occurrence of the delimiter "_".

Here is what I have :


I always seem to get "lmn" when I want to return "b"

Also if I specify input string as "lmn_a" - would it be possible to return null or an empty string ?

Thanks ,
-anagha
Adam Vinueza
Ranch Hand

Joined: Apr 16, 2001
Posts: 76
You're calling the nextToken method only once, which is why you get "lmn" instead of "b". Try something like this instead:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of String Tokeniser to get data after second occurrence of "_"
 
Similar Threads
Regarding string tokenizer
empty tokens in String Tokenizer
Hi
Memory leak while using String tokenizer
converting this to a prefix instead of a postfix calculator