I need to get this string before my separator, in this case a pipe character ('|'
).
So if I have this data:
Malcolm Bell Landgraab | EMP-00012 | Consultant
Juliawati Sandra | EMP-00003 | Consultant
I want this output:
['Malcolm Bell Landgraab', 'EMP-00012', 'Consultant']
['Juliawati Sandra', 'EMP-00003', 'Consultant']
How can I accomplish this task?
someString.split('\\|')
. I cleaned up your question for you, they're a lot more accessible as text.