How to replace backslash followed by 't' or any other alphabet or character in escape chacter in file path to forward slash in java?
问题 I'm importing a CSV file to MySQL database. This can be done using java.mysql support for forward slash in file path. If user gives the path String filepath=" c:\upload\date\csv\sample.csv"; we can do it by replacing '\' with '/' using following line of code. String filepath2=filepath.replace("\\","/"); but when user enters path as follows String filepath=" c:\test.csv"; the replace function unable to replace "\\" with "/" as '\' in the filepath does not remain '\' as '\' is followed by 't'