---
title: prefix
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/xmlnode/prefix
---

# prefix

Returns the prefix of the receiver’s name.

## Declaration

```swift
var prefix: String? { get }
```

## Return Value

Return Value A string containing the receiver’s prefix. This method returns an empty string if the receiver’s name is not qualified by a namespace.

## Discussion

Discussion The prefix is the part of a namespace-qualified name that precedes the colon. For example, “acme” is the prefix in the qualified name “acme:chapter”.

## See Also

### Managing Namespaces

- [localName](foundation/xmlnode/localname.md)
- [localName(forName:)](foundation/xmlnode/localname(forname:).md)
- [prefix(forName:)](foundation/xmlnode/prefix(forname:).md)
