Prova così:

codice:
String s1 =  "c:\Programmi\libero.txt";
String s2 = s1.replaceAll("\","/");