Here you can find the source of endsWithoutPathSeparator(final String path)
Parameter | Description |
---|---|
path | the prospective path. |
public static String endsWithoutPathSeparator(final String path)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**/*from w ww . j a va2 s . co m*/ * Make sure a given path does not end with a path separator character. * * @param path the prospective path. * @return the path guaranteed to NOT end with a path separator character. */ public static String endsWithoutPathSeparator(final String path) { String returnedPath; if (path.endsWith("/") || path.endsWith("\\")) { returnedPath = path.substring(0, path.length() - 1); } else { returnedPath = path; } return returnedPath; } }