allBeforeLastN method

String allBeforeLastN(
  1. int n
)

get all characters from string before last n characters.

Implementation

String allBeforeLastN(int n) => substring(0, length - n);