First Last with angle-bracket email
Input
EmailContact.from_string('John Doe <john@example.com>').email
Output
john@example.com
Parses the email between '<' and '>' and sets first and last names.
Full lesson preview
Implement a classmethod alternate constructor that parses several common string formats to build an object instance.
Problem statement
Task
Examples
Input
EmailContact.from_string('John Doe <john@example.com>').email
Output
john@example.com
Parses the email between '<' and '>' and sets first and last names.
Input format
Output format
Constraints
Samples
Input
EmailContact.from_string('Doe, Jane <jane.doe@example.org>').display_name
Output
Jane Doe
Handles comma-separated last, first format and title-cases names.