toSlug method

String toSlug({
  1. String delimiter = '_',
})

Generate slug of a given String

Implementation

String toSlug({String delimiter = '_'}) {
  String text = this.validate().trim().toLowerCase();
  return text.replaceAll(' ', delimiter);
}