I have a string which is a path taken dynamically from my system.
I store it in a string.
C:\Users\SXR8036\Downloads\LANE-914.xls
I need to pass this path to a read Excel file function, but it needs the backslashes to be replaced with forward slash.
And I want something like C:/Users/SXR8036/Downloads/LANE-914.xls
,
i.e., all backslashes replaced with forward ones.
With the String replace method, I am only able to replace with a-z characters, but it shows an error when I replace special characters.
something.replaceAll("[^a-zA-Z0-9]", "/");
I have to pass the String name to read a file.