I have this variable:
protected ArrayList<String> list = new ArrayList<String>();
The data is in this form:
data = date + ": " + y + "L/100KM "+ " " + value1 + "dt "+ value2 + "KM\n";
I want to retrieve a data value1 from it. How can I do this?
you can just split on whitespace like this:
your value1 should be third item in this array, so you can access it by calling:
Or if you wrote this code why the hell would you try to get value from a string where you just put that value yourself. 🙂