Skip to main content

proper_join

Function proper_join 

Source
pub fn proper_join<T: AsRef<str>>(items: &[T]) -> String
Expand description

Join a list of strings with proper English punctuation. Examples:

  • [] -> “”
  • [“apple”] -> “apple”
  • [“apple”, “banana”] -> “apple and banana”
  • [“apple”, “banana”, “cherry”] -> “apple, banana and cherry”