removeRight method

String removeRight(
  1. int characters
)

return a new string removing last n characters

Implementation

String removeRight(int characters) {
  return this.substring(0,this.length-characters);
}