FilesGetRelativePath(String, String) Method

Gets the relative path to target from the baseDirectory. This overload performs a case insensitive comparison.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.0.0
C#
public static string GetRelativePath(
	string target,
	string baseDirectory
)

Parameters

target  String
The target file or directory name. Can be either an absolute path or a relative one to current directory.
baseDirectory  String
The base directory to which the relative target path should be determined.

Return Value

String
The relative path of target from baseDirectory, or the absolute path of target if there is no relative path between them.

Exceptions

ArgumentNullExceptiontarget or baseDirectory is .

See Also