Possible Duplicate:
Hints for java.lang.String.replace problem?
Using string.replace() in Java
Why "/" does not replaced by "_" ?
public static void main(String[] args) throws IOException {
String file = "A/B";
file.replaceAll("/", "_");
System.out.println(file);
}