Java Path Format formatPath(String path)

Here you can find the source of formatPath(String path)

Description

format Path

License

Open Source License

Declaration

public static String formatPath(String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {

    public static String formatPath(String path) {
        if (path.contains("/")) {
            path = path.replace("/", File.separator);
        }//from  ww  w  .  j  a v a  2  s  .  c om
        if (path.contains("\\")) {
            path = path.replace("/", File.separator);
        }
        return path;
    }
}

Related

  1. formatPath(String inputPath)
  2. formatPath(String path)