I am trying to break up a very simple set of lines that go into forms
0|0
10|15
30|55
etc. Essentially numbers separated by pipes.
When I use java string split function with .split ("|"). I get some unpredictable results. a space in the first slot, sometimes the number itself is not where I thought it should be.
Can someone help and give me advice, how can I use reg exp to store ONLY integers?
I was asked to give a code trying to make the actual split. So let me do this to further clarify my problem :)
String temp = "0|0";
String splitString = temp.split("|");
results
\n
0
|
0
I'm trying to get
0
0
only. Thanks forever for any help in advance :)
source
share