System.Net.FtpClient.FtpExtensions.GetFtpPath C# (CSharp) Method

GetFtpPath() public static method

Converts the specified path into a valid FTP file system path
public static GetFtpPath ( this path ) : string
path this The file system path
return string
        public static string GetFtpPath(this string path)
        {
            if (String.IsNullOrEmpty(path))
                return "./";

            path = Regex.Replace(path.Replace('\\', '/'), "[/]+", "/").TrimEnd('/');
            if (path.Length == 0)
                path = "/";

            return path;
        }