I was wondering how to correctly split the string when you have an unknown number of underscores. My input looks like this:
One Two_________1.0 2.0 3.0
Three Four______4.0 5.0 6.0
Five Six________7.0 8.0 9.0
Between words and numbers there is unknown number of underscores. I need to split this input into words and numbers. I tried using split
in this way:
details = input.split("_")
words = details[0]
numbers = details[1]
However, it correctly saves only words. It worked when I changed the input to have only one underscore, however I just cannot find the solution when it has multiple underscores.