---
title: removingRoot()
framework: system
role: symbol
role_heading: Instance Method
path: system/filepath/removingroot()
---

# removingRoot()

Creates a new path containing just the components, i.e. everything after root.

## Declaration

```swift
func removingRoot() -> FilePath
```

## Discussion

Discussion Returns self if root == nil. Examples: Unix: /foo/bar => foo/bar foo/bar  => foo/bar /        => "" Windows: C:\foo\bar                  => foo\bar foo\bar                     => foo\bar \\?\UNC\server\share\file   => file \\?\device\folder\file.exe  => folder\file.exe \\server\share\file         => file \                           => ""
