Here you can find the source of normalise(String path)
public static final String normalise(String path)
//package com.java2s; //License from project: Open Source License public class Main { public final static char SLASH_CHAR = '/'; public final static char BACK_SLASH_CHAR = '\\'; public static final String normalise(String path) { return normalise(path, BACK_SLASH_CHAR, SLASH_CHAR); }//w ww .ja va 2 s . co m public static final String normalise(String path, char separator) { return normalise(path, separator, separator); } public static final String normalise(String path, char separator, char newSeparator) { if (path != null) { String p = path.trim(); if (separator != newSeparator) { p = p.replace(separator, newSeparator); } p.replaceAll("\\" + newSeparator + "{2,}", "\\" + newSeparator); return p; } return null; } }