Contents

listType

The type of the list.

Declaration

var listType: ListFormatStyle<Style, Base>.ListType

Discussion

The list type determines the semantics used in the return string.

For example, for en_US:

["One", "Two", "Three"].formatted(.list(type: .and))
// “One, Two, and Three”

["One", "Two", "Three"].formatted(.list(type: .or))
// “One, Two, or Three” 

The default value is ListFormatStyle.ListType.and.

See Also

Modifying a list format style