SCLoaderShared/Helpers/PathHelpers.cs
/// <summary>
/// Combines path parts with respect to the current platform (Win/Linux etc.)
/// Fixes mixed slashes and back-slashes
/// Removes illegal characters from filename
/// </summary>
/// <param name="paths"></param>
/// <returns></returns>
Combines path parts with respect to the current platform (Win/Linux etc.)
Fixes mixed slashes and back-slashes
Removes illegal characters from filename
Combines path parts with respect to the current platform ( Win / Linux etc . ) Fixes mixed slashes and back - slashes Removes illegal characters from filename
public static string GetWorkingCombinedPath(params string[] paths)
        {
            var length = paths.Length;
            string[] fixedPaths = new string[length];
            for (var i = 0; i < length; i++)
            {
                if (paths[i].Contains("."))
                {
                    fixedPaths[i] = FixPathSeparators(CleanIllegalFilenameCharacters(paths[i]), false);
                }
                else
                {
                    fixedPaths[i] = FixPathSeparators(paths[i], true);
                }
            }
            return Path.Combine(fixedPaths);
        }
public static string GetWorkingCombinedPath ( params string [ ] paths ) { var length = paths . Length ; string [ ] fixedPaths = new string [ length ] ; for ( var i = 0 ; i < length ; i ++ ) { if ( paths [ i ] . Contains ( " " ) ) { fixedPaths [ i ] = FixPathSeparators ( CleanIllegalFilenameCharacters ( paths [ i ] ) , false ) ; } else { fixedPaths [ i ] = FixPathSeparators ( paths [ i ] , true ) ; } } return Path . Combine ( fixedPaths ) ; }
Combines path parts with respect to the current platform (Win/Linux etc.)
Combines path parts with respect to the current platform ( Win / Linux etc . )
// Filename -> no trailing slash // Directory -> add trailing slash
None
paths
None