I was using Eclipse for Java and I want to split a number without losing other same characters.
For example, the input line is:
[1142,143,2142,142]
the output should be like that:
1142 143 2142
i was using split("142|\\D+")but the output was showing like this:
1 143 2
What should I do ?
String [] tokens = input.split(",");