removeLast static method

String removeLast(
  1. String string, [
  2. int? upto
])

Remove last element of string

Implementation

static String removeLast(String string, [int? upto]) =>
    string.minLen(2) ? string.substring(0, string.length - upto!) : "";