You can read two tokens and then concatenate them
it seems that there is two spaces after token you want. If it's true you can use
indexOf
to get index of two spaces and then use substring.You can use
Scanner.next(pattern)
to get this string. all you need is correct pattern
StringTokenizer, forget a deliminiter
-
22-06-2023 - |
Question
I'm currently stringtokenizing the following line.
2014-03-24 19:11:42.838 7611.668 UDP 192.168.0.15:5353 -> 224.0.0.251:5353 53 5353 12
I actually want the "2014-03-24 19:11:42.838" as a token itself but I cant seem to figure out how to get the stringtokenizer to skip the space in between.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow