Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
735 views
in Technique[技术] by (71.8m points)

file path Windows format to java format

I need to convert the file path in windows say C:Documents and SettingsManojDesktop for java as C:/Documents and Settings/Manoj/Desktop .

Is there any utility to convert like this.?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
String path = "C:\Documents and Settings\Manoj\Desktop";
path = path.replace("", "/");
// or
path = path.replaceAll("", "/");

Find more details in the Docs


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...