I have this string: £0,00
Which i want to replace with float 3.95 for instance. But i want to keep the £ and the ","
So result -> £3,95
How would i do it?
--
Added some details:
Will the currency symbol always be a £?
The currency symbol might be before and sometimes behind the numbers. ie 0,00 kr
Will the separator always be ,, or might it be . or even an arbitrary character?
The separator might be . sometimes.
Will there always be two decimal places?
The decimal will always be 2 places.
How many integer digits might there be, and will there be a thousands separator?
It will not be above 100.
£? Will the separator always be,, or might it be.or even an arbitrary character? Will there always be two decimal places? How many integer digits might there be, and will there be a thousands separator? These are all important, since your original question can be answered trivially by ignoring the first and third characters, parsing the float and then adding them back in again. The range of valid input values is the essence of the question.