title: how to remove elements added in a string with event.unicode in pygame?
body: <p>I have a function in my program so that the player can type his name that will then appear on the screen. But is there a way so when the player hit the backspace key for example, the last letter added to the string is removed ? </p>
  
  <p>Heres the function, I don't think I need to write the rest of the code concerning the name of the player :</p>
  
  <pre><code>def enter_player_name(self):
      player_name_screen = True
      while player_name_screen:
          win.blit(playerNameImg[self.namecount//1], (self.x_0, self.y_0))
          self.namecount += 1
          if (self.namecount + 1) &gt;= 8:
              self.namecount = 0
          for event in pg.event.get():
              if event.type == pg.KEYDOWN:
                  if event.key == pg.K_RETURN:
                      print(self.name)
                      player_name_screen = False
                      self.display = GAME_SCREEN
                  else:
                      self.name += event.unicode
                      self.text_name = game_font.render(self.name, True, BLANC)
          win.blit(self.text_name, (500, 500))
          pg.display.update()
  </code></pre>
  
  <p>Thanks for you help !</p>