Carrotware.Web.UI.Controls.FileDataHelper.MakeFilePathUniform C# (CSharp) Method

MakeFilePathUniform() public static method

public static MakeFilePathUniform ( string sDirPath ) : string
sDirPath string
return string
        public static string MakeFilePathUniform(string sDirPath)
        {
            string _path = "/";
            if (!string.IsNullOrEmpty(sDirPath)) {
                _path = @"/" + sDirPath;

                if (!Directory.Exists(WWWPath + _path)) {
                    _path = _path.Replace(@"\", @"/");
                    _path = _path.Substring(0, _path.Length - 1);
                    _path = _path.Substring(0, _path.LastIndexOf(@"/"));
                }
                _path = _path + @"/";
                _path = _path.Replace(@"\", @"/").Replace(@"///", @"/").Replace("//", "/").Replace("//", "/");
            }
            return _path;
        }