Skip to content

Modern Fs PathRootLen

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Filesystem › Filesystem Library › PathRootLen

PathRootLen

Returns the length of a path's root, in characters.

Syntax

PathRootLen( p )

Notes

  • length of the root prefix, in code units

Examples

#import "std/fs"
using fs

print PathRootLen( "C:\dev\src" )         '' 3 -- "C:\"
print PathRootLen( "relative" )           '' 0

'' The length in CODE UNITS, so it can index the original string
dim as ustring p = "C:\dev\src"
print mid( p, PathRootLen( p ) + 1 )      '' dev\src

Library: Filesystem Library
Category: Filesystem
Documented under: Paths

Clone this wiki locally