Toot

Written by mattcomi on 2025-01-10 at 05:33

A little Swift treasure: list formatting.

[“Tom", "Harry”].formatted()

"Tom and Harry”

[“Charles", "Delia", "Lydia”].formatted()

"Charles, Delia, and Lydia”

It is, of course, locale sensitive, and supports a ListType of and and or.

[“Carreras", “Pavarotti", “Domingo”]

.formatted(.list(type: .or).locale(.init(identifier: "it_it")))

"Carreras, Pavarotti o Domingo”

=> More informations about this toot | View the thread | More toots from mattcomi@hachyderm.io

Mentions

Tags

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113802427295919079
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
225.061702 milliseconds
Gemini-to-HTML Time
0.482847 milliseconds

This content has been proxied by September (ba2dc).