src/Misc/EFTools/XmlCore/Common/FileUtils.cs
/// <summary>
///     Make sure the full path does not end in a backslash
/// </summary>
/// <param name="fullPath"></param>
/// <returns></returns>
Make sure the full path does not end in a backslash
Make sure the full path does not end in a backslash
public static string EnsureNoBackslash(string fullPath)
        {
            var retString = fullPath;
            if (string.IsNullOrEmpty(fullPath) == false
                &&
                fullPath.Length > 1)
            {
                if (fullPath[fullPath.Length - 1] == '\\'
                    ||
                    fullPath[fullPath.Length - 1] == '/')
                {
                    retString = fullPath.Substring(0, fullPath.Length - 1);
                }
            }
            return retString;
        }
public static string EnsureNoBackslash ( string fullPath ) { var retString = fullPath ; if ( string . IsNullOrEmpty ( fullPath ) == false && fullPath . Length > 1 ) { if ( fullPath [ fullPath . Length - 1 ] == ' \\ ' || fullPath [ fullPath . Length - 1 ] == ' ' ) { retString = fullPath . Substring ( 0 , fullPath . Length - 1 ) ; } } return retString ; }
Make sure the full path does not end in a backslash
Make sure the full path does not end in a backslash
None
fullPath
string
None