def _strip_after_pound(string):
    """
    Treat "#" as a comment character and remove everything after.
    """
    msg = ""
    for char in string:
        if char != "#":
            msg = msg + char
        else:
            return msg
    return msg