There is a text string that I need to work with:
TEST:ABCDEGF:18:32
This text includes letters and numbers, but I want to extract all of them excluding the :
character.
Previously, I was using the following code successfully:
lines.split(":");
However, I now have a new requirement where I also need to extract the time in full form like 18:32
, which means simply using split
won't cut it because it only gives me until 18
.
So, how can I modify my approach in order to extract the time as well?
For example:
ABCDED:ERERE:18:32
Desired output:
temp.fields[0] = ABCDED
temp.fields[1] = ERERE
temp.fields[2] = 18:32