Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Email Validation Challenge | String Advanced
Java Extended
course content

Зміст курсу

Java Extended

Java Extended

1. Deep Java Structure
2. Methods
3. String Advanced
4. Classes
5. Classes Advanced

bookEmail Validation Challenge

Завдання

Your task is to implement email validation by trimming any leading and trailing spaces from the string. Then, check the email's validity based on three conditions: there must be characters before the @ symbol, there must be characters after the @, and the domain after the @ must contain a dot. If the email is valid, extract and display the domain (the part after the @ symbol, excluding the symbol itself).

  1. In the validateEmail method, find the index of the @ symbol in the email.
  2. In the validateEmail method, find the index of the first dot (.) symbol in the email.
  3. Check that the @ index is greater than 0, and the dot index is greater than the @ index and less than the length of the email minus 1.
  4. In the extractDomainFromEmail method, find the index of the @ symbol in the ``email`.
  5. Extract and return the substring starting from the character immediately after @ in the extractDomainFromEmail method.
  6. In the main method, trim any leading and trailing spaces from the email string.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 7
toggle bottom row

bookEmail Validation Challenge

Завдання

Your task is to implement email validation by trimming any leading and trailing spaces from the string. Then, check the email's validity based on three conditions: there must be characters before the @ symbol, there must be characters after the @, and the domain after the @ must contain a dot. If the email is valid, extract and display the domain (the part after the @ symbol, excluding the symbol itself).

  1. In the validateEmail method, find the index of the @ symbol in the email.
  2. In the validateEmail method, find the index of the first dot (.) symbol in the email.
  3. Check that the @ index is greater than 0, and the dot index is greater than the @ index and less than the length of the email minus 1.
  4. In the extractDomainFromEmail method, find the index of the @ symbol in the ``email`.
  5. Extract and return the substring starting from the character immediately after @ in the extractDomainFromEmail method.
  6. In the main method, trim any leading and trailing spaces from the email string.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 7
toggle bottom row

bookEmail Validation Challenge

Завдання

Your task is to implement email validation by trimming any leading and trailing spaces from the string. Then, check the email's validity based on three conditions: there must be characters before the @ symbol, there must be characters after the @, and the domain after the @ must contain a dot. If the email is valid, extract and display the domain (the part after the @ symbol, excluding the symbol itself).

  1. In the validateEmail method, find the index of the @ symbol in the email.
  2. In the validateEmail method, find the index of the first dot (.) symbol in the email.
  3. Check that the @ index is greater than 0, and the dot index is greater than the @ index and less than the length of the email minus 1.
  4. In the extractDomainFromEmail method, find the index of the @ symbol in the ``email`.
  5. Extract and return the substring starting from the character immediately after @ in the extractDomainFromEmail method.
  6. In the main method, trim any leading and trailing spaces from the email string.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Завдання

Your task is to implement email validation by trimming any leading and trailing spaces from the string. Then, check the email's validity based on three conditions: there must be characters before the @ symbol, there must be characters after the @, and the domain after the @ must contain a dot. If the email is valid, extract and display the domain (the part after the @ symbol, excluding the symbol itself).

  1. In the validateEmail method, find the index of the @ symbol in the email.
  2. In the validateEmail method, find the index of the first dot (.) symbol in the email.
  3. Check that the @ index is greater than 0, and the dot index is greater than the @ index and less than the length of the email minus 1.
  4. In the extractDomainFromEmail method, find the index of the @ symbol in the ``email`.
  5. Extract and return the substring starting from the character immediately after @ in the extractDomainFromEmail method.
  6. In the main method, trim any leading and trailing spaces from the email string.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 3. Розділ 7
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
some-alt