firstCharacters method

String firstCharacters(
  1. int count
)

Implementation

String firstCharacters(int count) {
  if (count >= this.length) {
    return this;
  } else {
    return this.substring(0, count) + "...";
  }
}