prefix method

String prefix(
  1. int count
)

Implementation

String prefix(int count) {
  if (count <= this.length) {
    return substring(0,count);
  }
  return this;
}