Somethin strange about ^
I'm trying to eliminate all the ^ in a string by using the replaceAll method.
This is the code...
class Test
{
public static void main(String[] args)
{
String string = "^";
System.out.println(string);
string = string.replaceAll("^","here's one!!");
System.out.println(string);
}
}
The above code compiles fine but when I run it, I dunno... I got a very strange output!! The output I got is-
C:\workarea>javac Test.java
C:\workarea>java Test
^
here's one!!^
^ isn't removed but the replace string (here's one!!) is COMING!!
I tried it with ~(instead of ^) but that's workin.. Does anybody know what's goin on?

