Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem with replaceAll() in java

686542Mar 31 2008 — edited Mar 31 2008
hi

i need to replace a " * ", from a String, but it show me an exception
String temp = "Rajesh*Beu";
temp.replaceAll("*","_");
System.out.println(temp);
Exception is
Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*
^
from this, i came to know that, java using * as internal pointer.
but my requirement is to change * to some other character...........
please help me, if you find....

thank you,
rajesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2008
Added on Mar 31 2008
8 comments
382 views