Removing characters from a string
Hi,
I have a requirement of removing all the characters from a string to get the double value.
So my variable would have a value like "EUR123.35", I want to get 123.35 from it. We can have any type and number of characters in the string.
SO I have the following code
#CODE
Pattern m_Pattern = Pattern.compile("a-zA-Z");
priceTag=priceTag.replace(m_Pattern.pattern(), "");
#ENDCODE
I am using java 1.4.2. I get the following error
java.lang.NoSuchMethodError: java.lang.String.replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
I find that this method has been implemented in 1.5. So how can I implement it pre 1.5 version...
thanks as always for your time and feedback...
cheers

