|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
FULL PRODUCT VERSION :
java version "1.4.2_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05)
Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Win XP
A DESCRIPTION OF THE PROBLEM :
import java.io.File;
public class Test
{
public static void main(String[] argv)
{
String str = "file after replace ? ";
String fname = "C:"+File.separator+"abc"+File.separator+"test";
System.out.println(fname);
str = str.replaceFirst("[?]", fname);
System.out.println(str);
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
in above program it should produce :
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
C:\abc\test
file after replace C:\abc\test
ACTUAL -
C:\abc\test
file after replace C:abctest
has eaten up '\' from replacement string, I believe replacement string should not be parsed but just copied
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
public class Test
{
public static void main(String[] argv)
{
String str = "file after replace ? ";
String fname = "C:"+File.separator+"abc"+File.separator+"test";
System.out.println(fname);
str = str.replaceFirst("[?]", fname);
System.out.println(str);
}
}
---------- END SOURCE ----------
###@###.### 2005-06-06 07:05:00 GMT
|