import re


def port_to_string(port):
    """
    Returns clear number string containing port number.
    :param port: port in integer (1234) or string ("1234/tcp") representation.
    :return: port number as number string ("1234")
    """
    port_type = type(port)
    if port_type is int:
        return str(port)
    if port_type is str:
        return re.findall(r"\d+", port)[0]