Method pathname.isFullPath
Overload
Returns true if the string is full path, like @"C:\a\b.txt" or @"C:" or @"\\server\share\...":
public static bool isFullPath(ReadOnlySpan<char> path, bool orEnvVar = false)
Parameters
|
path (ReadOnlySpan<char>)
Any string. Can be |
|
orEnvVar (bool)
Also return |
Returns
Remarks
Returns true if path matches one of these wildcard patterns:
-
@"?:\*"- local path, like@"C:\a\b.txt". Here?is A-Z, a-z. -
@"?:"- drive name, like@"C:". Here?is A-Z, a-z. -
@"\\*"- network path, like@"\\server\share\...". Or has prefix@"\\?\".
Supports '/' characters too.
Supports only file-system paths. Returns false if path is URL (pathname.isUrl) or starts with "::".