Problem with ^ while using java.lang.String.replaceAll method
Hi folks!!
I have a string which contains the character ^. Now, I tried removing this by using replaceAll method in String... but I got weird output!! Just check it out......
This is my program-
class Test
{
public static void main(String[] args)
{
String string = "^";
System.out.println(string);
string = string.replaceAll("^","here's one!!");
System.out.println(string);
}
}
I saved it in C:\workarea and compiled it. But when I run it i got-
C:\workarea>java Test
^
here's one!!^
^ isn't removed but the replace string comes in the first position!!!!
Can anybody tell what's going on? Is it a mistake in the program or ma mistake with my eyes? :-0

