Pascal Scripting: RemoveBackslashUnlessRoot

Prototype

function RemoveBackslashUnlessRoot(const S: String): String;

Description

Returns the specified string with any trailing slashes/backslashes removed, unless the string specifies the root directory of a drive (e.g. C:\ or \), in which case it leaves 1 slash.