starts(with:)
Returns whether other is a prefix of self, only considering whole path components.
Declaration
func starts(with other: FilePath) -> BoolDiscussion
Example:
let path: FilePath = "/usr/bin/ls"
path.starts(with: "/") // true
path.starts(with: "/usr/bin") // true
path.starts(with: "/usr/bin/ls") // true
path.starts(with: "/usr/bin/ls///") // true
path.starts(with: "/us") // false