<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_trailing_string(content, trailing):
 """ Strip trailing component `trailing` from `content` if it exists. Used when generating names from view classes. """

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