System.Web.VirtualPathUtility.RemoveTrailingSlash Method

Removes a trailing slash mark (/) from a virtual path.

Syntax

public static string RemoveTrailingSlash (string virtualPath)

Parameters

virtualPath
The virtual path to remove any trailing slash mark from.

Returns

A virtual path without a trailing slash mark, if the virtual path is not already the root directory ("/"); otherwise, null.

Remarks

The VirtualPathUtility.RemoveTrailingSlash(string) method removes a slash mark (/) from the end of the virtual path. If the virtual path is already the root directory ("/"), no action is taken. If the virtual path is null or an empty string (""), the VirtualPathUtility.RemoveTrailingSlash(string) method returns null.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0