def remove_comment(string_entry):
    """
    Takes a single line and removes and .ini type comments.
    Also remove any spaces at the begining or end of a commented line
    """
    result = string_entry

    # Comment checking
    for c in '#;':
        if c in result:
            result = result.split(c)[0]

    return result