Wednesday, 2 October 2013

Split string in numbering

Split string in numbering

i want to ask a question. I have a text file of list of commands:
1. eat, food
7am
2. brush, teeth
8am
3. crack, eggs
1pm
How can we get:
"eat, food\n7am"
"brush, teeth\n8am"
"crack, eggs\n1pm"
I'm trying to use the classic split(), but so far i haven't figured out
how to get rid of the numbers.. Any suggestions?

No comments:

Post a Comment