Methods to check is a character is a valid prefix/domain character Write the following two methods: A
Question:
Methods to check is a character is a valid prefix/domain character Write the following two methods: A method isValidPrefixChar() that takes as input a character and returns true if the character can be used in the prefix of a valid email address, false otherwise. Note that a valid prefix can contain only alphanumeric characters, dashes, periods, or underscores. For example, isValidPrefixChar('_') returns true, while isValidPrefixChar('&') returns false. A method isValidDomainChar() that takes as input a character and returns true if the character can be used in the domain (first portion) of a valid email address, false otherwise. Note that a valid first portion of a domain can contain only alphanumeric characters, dashes, or periods. For example, isValidDomainChar('-') returns true, while isValidDomainChar('_') returns false. To get full marks, your method must use the isAlphanumeric() method defined above
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss