Here you can find the source of truncateLeadingSlash(String uri)
/
in the given uri
will be removed.
Parameter | Description |
---|---|
uri | the Uri to remove leading slashes from. |
public static String truncateLeadingSlash(String uri)
//package com.java2s; /*/*from w w w. ja va 2s. c o m*/ * $Header: /var/chroot/cvs/cvs/factsheetDesigner/extern/jakarta-slide-server-src-2.1-iPlus Edit/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v 1.2 2006-01-22 22:55:21 peter-cvs Exp $ * $Revision: 1.2 $ * $Date: 2006-01-22 22:55:21 $ * * ==================================================================== * * Copyright 1999-2002 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ public class Main { /** * Any leading <code>/</code> in the given <code>uri</code> will be removed. * * @param uri the Uri to remove leading slashes from. * * @return the Uri without leading slashes. */ public static String truncateLeadingSlash(String uri) { if (uri == null) { return uri; } while (uri.startsWith("/")) { uri = uri.substring(1); } return uri; } }