String quantity = cboAmount.getSelectedItem().toString();
String product = cboProduct.getSelectedItem().toString();
String price = product.replaceAll("(\\d+(?:\\.\\d{1,2})?)", "");
textareaOrder.setText(price);
I want to extract the price from some text in a combobox, I've googled people's solutions but they all didn't work, the one in the example displays everything but the price. I don't know if I'm missing something here. The text in the combobox is written like this "Orange: 2.00" if that matters.
Tried to extract price from a string but didn't get it