problem with single quote

in the below code i want to replace single quote character with some other character.

i am getting error in replacing single quote.how can i do this.

please help me.

class test

{

public static void main(String[] args)

{

String str="don't";

String str1=str.replace(''','#');

System.out.println(str1);

}

}

[398 byte] By [reddy94] at [2007-9-26 2:49:31]
# 1

> in the below code i want to replace single quote

> character with some other character.

> i am getting error in replacing single quote.how can i

> do this.

> please help me.

>

> class test

> {

> public static void main(String[] args)

> {

> String str="don't";

> String str1=str.replace(''','#');

> System.out.println(str1);

> }

> }

\ is the escape character so it should be:

String str1=str.replace('\'','#');

kathymc at 2007-6-29 10:35:32 > top of Java-index,Archived Forums,Java Programming...