I have a string which is:
<p>1+: €0,09756<br>3.001+: €0,09338<br>
30.001+: €0,09338<br>150.001+: €0,09338<br>
750.001+: €0,09338<br>
</p>
Now what I would like to do is I would like to call article.addPrice(new Integer(quantity), new Float(price));
for each of these lines which are separated by the <br>
. Meaning the result is:
article.addPrice(new Integer(1), new Float(0.09756));
article.addPrice(new Integer(3001), new Float(0.09338));
article.addPrice(new Integer(30001), new Float(0.09338));
article.addPrice(new Integer(150001), new Float(0.09338));
article.addPrice(new Integer(750001), new Float(0.09338));
The integer is stripped of all special characters, the float too. The currency symbol will be ignored. If the Price of the next line is the same as the one before the article.addPrice
will not be performed.
What is the most efficient way of doing this?