and method

String and({
  1. String separator = 'and',
})

Append separator as the last position.

['Hello', 'Dart'].and(); // Hello and Dart

Implementation

String and({String separator = 'and'}) {
  return '${sublist(0, length - 1).join(', ')} $separator $last';
}