---
title: ExpressibleByStringLiteral
framework: swift
role: symbol
role_heading: Protocol
path: swift/expressiblebystringliteral
---

# ExpressibleByStringLiteral

A type that can be initialized with a string literal.

## Declaration

```swift
protocol ExpressibleByStringLiteral : ExpressibleByExtendedGraphemeClusterLiteral
```

## Overview

Overview The String and StaticString types conform to the ExpressibleByStringLiteral protocol. You can initialize a variable or constant of either of these types using a string literal of any length. let picnicGuest = "Deserving porcupine" Conforming to ExpressibleByStringLiteral To add ExpressibleByStringLiteral conformance to your custom type, implement the required initializer.

## Topics

### Associated Types

- [StringLiteralType](swift/expressiblebystringliteral/stringliteraltype.md)

### Initializers

- [init(stringLiteral:)](swift/expressiblebystringliteral/init(stringliteral:).md)

## Relationships

### Inherits From

- [ExpressibleByExtendedGraphemeClusterLiteral](swift/expressiblebyextendedgraphemeclusterliteral.md)
- [ExpressibleByUnicodeScalarLiteral](swift/expressiblebyunicodescalarliteral.md)

### Inherited By

- [ExpressibleByStringInterpolation](swift/expressiblebystringinterpolation.md)
- [StringProtocol](swift/stringprotocol.md)

### Conforming Types

- [StaticString](swift/staticstring.md)
- [String](swift/string.md)
- [String.LocalizationValue](swift/string/localizationvalue.md)
- [Substring](swift/substring.md)

## See Also

### String Literals

- [ExpressibleByExtendedGraphemeClusterLiteral](swift/expressiblebyextendedgraphemeclusterliteral.md)
- [ExpressibleByUnicodeScalarLiteral](swift/expressiblebyunicodescalarliteral.md)
- [ExpressibleByStringInterpolation](swift/expressiblebystringinterpolation.md)
- [StringInterpolationProtocol](swift/stringinterpolationprotocol.md)
- [DefaultStringInterpolation](swift/defaultstringinterpolation.md)
