---
title: urlHostAllowed
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nscharacterset/urlhostallowed
---

# urlHostAllowed

Returns the character set for characters allowed in a host URL subcomponent.

## Declaration

```swift
class var urlHostAllowed: CharacterSet { get }
```

## Discussion

Discussion The host component of a URL is usually the component immediately after the first two leading slashes. If the URL contains a username and password, the host component is the component after the @ sign. For example, in the URL http://username:password@www.example.com/index.html, the host component is www.example.com.

## See Also

### Getting Character Sets for URL Encoding

- [urlFragmentAllowed](foundation/nscharacterset/urlfragmentallowed.md)
- [urlPasswordAllowed](foundation/nscharacterset/urlpasswordallowed.md)
- [urlPathAllowed](foundation/nscharacterset/urlpathallowed.md)
- [urlQueryAllowed](foundation/nscharacterset/urlqueryallowed.md)
- [urlUserAllowed](foundation/nscharacterset/urluserallowed.md)
