String with "and"

hi @Joanna_Lamb

My contribution is a bit different from the @Scott_Collier-Weir suggestion. I’d like to see the comma removed a the one but last list item.

Actually we have two lists we glue together using ‘and’

  1. the part containing all items but not the last
  2. the last item
Format("{1} and {2}",
Lamb.Slice(1,Lamb.Count()-1).List(),
Lamb.Last())

you may dislike the @ reference. To get rid of that you turn all items into text.

Format("{1} and {2}",
Lamb.Slice(1,Lamb.Count()-1).List(),
Lamb.Last()).ForEach(CurrentValue.ToText())

Enjoy, Cheers, Christiaan

2 Likes