KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to break apart a very simple collection of strings that come in the forms of 0|0 10|15 30|55 etc etc. Essentially numbers that are seperated by pipes. When I use java's string split function with .split("|"). I get somewhat unpredictable results. white space in the first slot, sometimes the number itself isn't where I thought it should be. Can anybody please help and give me advice on how I can use a reg exp to keep ONLY the integers? I was asked to give the code trying to do the actual split. So allow me to do that in hopes to clarify further my problem :) String temp = "0|0"; String splitString = temp.split("|"); results \n 0 | 0 I am trying to get 0 0 only. Forever grateful for any help ahead of time :)
Tags (comma-separated)
Save Edits
Cancel