I know its an old and tried question but i do not understand why this code does not work.
public class testreplace {
public static void main(
String args[]){
String key="$re$";
String value = "rec";
String message = "me $re$ now";
message = message.replaceAll(key,value);
System.out.println(newm);
}
}
Iam reading the key and value from a HashMap and i need to replace any occurance of a key with the value in the String.
Please help me out. Thanks in advance.