code: def endswith_strip(s, endswith='.txt', ignorecase=True):
      
      if ignorecase:
          if s.lower().endswith(endswith.lower()):
              return s[:-len(endswith)]
      else:
          if s.endswith(endswith):
              return s[:-len(endswith)]
      return s
docs: Strip a suffix from the end of a string
  
      >>> endswith_strip('http://TotalGood.com', '.COM')
      'http://TotalGood'
      >>> endswith_strip('http://TotalGood.com', endswith='.COM', ignorecase=False)
      'http://TotalGood.com'