create  public method for removing first and last characters of a string