Name: rmT116609 Date: 05/22/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows 2000 SP2
A DESCRIPTION OF THE PROBLEM :
The following command:
String s;
s = "test.help.kunde";
System.out.println(s.replaceAll(".","_"));
Results in:
_______________
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.javac Test.java
2.java Test
EXPECTED VERSUS ACTUAL BEHAVIOR :
Result should be (like in replace(char, char)):
test_help_kunde
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Test {
public static void main(String args[]) {
String s = "test.help.kunde";
System.out.println(s.replaceAll(".","_"));
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
Use: replace(char, char)
(Review ID: 146882)
======================================================================
- relates to
-
JDK-6325596 (spec) String.replaceFirst doc could be clearer about special characters in replacement string
-
- Closed
-