I need a better way of splitting the following string. I am not sure how to identify a substring and assign it to the correct variable:
at Manchester (Old Trafford) 24/8/1972 England won by 6 wickets [35 balls remaining]
I wanted to split the above string and assign substrings to different variables.
Venue --> Manchester (Old Trafford)
Date --> 24/8/1972
Result --> England won by 6 wickets [35 balls remaining]
I tried StringTokenizer
, but I felt it was too much work to get the assignment as above, and moreover it is too complex. When I used StringTokenizer
I got the following substrings:
at Manchester
(Old
Trafford)
24/8/1972
England
won
by
6
wickets
[35
balls
remaining]
Please suggest any better ways of doing it.