The input path string from which to extract the base directory.
Optional. If true, trims the trailing slash or backslash from the result. Defaults to false.
The base directory of the given path string, optionally trimmed of its trailing slash or backslash.
This function extracts the base directory from the provided
pathStr
. IftrimLastSlash
is true, the trailing slash or backslash is removed from the result. Handles both forward slashes (/
) and backslashes (``) as path separators.