Java Path String Clean cleanPath(String path, boolean trimStartSeparator)

Here you can find the source of cleanPath(String path, boolean trimStartSeparator)

Description

clean Path

License

LGPL

Declaration

public static String cleanPath(String path, boolean trimStartSeparator) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String cleanPath(String path, boolean trimStartSeparator) {
        path = path.replaceAll("[/\\\\]+", "/");
        if (trimStartSeparator) {
            path = path.replaceFirst("^/+", "");
        }//from  ww w . ja va  2  s. co m
        return path;
    }
}

Related

  1. cleanPath(String path)
  2. cleanPath(String path)
  3. cleanPath(String path)
  4. cleanPath(String path)
  5. cleanPath(String path)
  6. cleanPath(String s)
  7. cleanPath(String sText, boolean isWindows)
  8. cleanPathSegment(final String toClean)
  9. filePathReplaceAll(String value)