@classmethod
def from_str(cls, string: str) ->'Characters':
    """Returns a new instance with control characters set to given string.
        :param string: The string to set the control characters to
        """
    if string[0:3] == 'UNA':
        string = string[3:9]
    assert len(string) >= 6
    characters = cls()
    characters.component_separator = string[0]
    characters.data_separator = string[1]
    characters.decimal_point = string[2]
    characters.escape_character = string[3]
    characters.reserved_character = string[4]
    characters.segment_terminator = string[5]
    return characters
