---
title: "string(from:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/listformatter/string(from:)"
---

# string(from:)

Creates a formatted string for an array of items.

## Declaration

```swift
func string(from items: [Any]) -> String?
```

## Parameters

- `items`: An array of objects to format as a list.

## Return Value

Return Value A formatted string representing the list of objects in an array. Returns nil if the formatter can’t generate a description for all objects in the array, or if obj is nil.

## Discussion

Discussion The list formatter uses itemFormatter to format each item in the array. If itemFormatter doesn’t apply to a particular item, the list formatter falls back to the item’s description(withLocale:) or localizedDescription if implemented. If those methods aren’t implemented, the formatter uses description instead.

## See Also

### Converting Arrays to Formatted Lists

- [string(for:)](foundation/listformatter/string(for:).md)
- [localizedString(byJoining:)](foundation/listformatter/localizedstring(byjoining:).md)
