FilesGetRelativePath(String, String, Boolean) Method

Gets the relative path to target from the baseDirectory.

Definition

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

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.
isCaseSensitive  Boolean
to perform a case-sensitive comparison; to perform a case-insensitive comparison.

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