def remove_trailing_string(content, trailing):
 if (content.endswith(trailing) and (content != trailing)):
  return content[:(- len(trailing))]
 return content

def remove_trailing_string ( content , trailing ) : if ( content . endswith ( trailing ) and ( content != trailing ) ) : return content [ : ( - len ( trailing ) ) ] return content
strip trailing component trailing from content if it exists .