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

Conteúdo do Curso

Java Extended

Java Extended

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

bookChallenge: Email Validation

Tarefa
test

Swipe to show code editor

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 7
toggle bottom row

bookChallenge: Email Validation

Tarefa
test

Swipe to show code editor

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 7
toggle bottom row

bookChallenge: Email Validation

Tarefa
test

Swipe to show code editor

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Tarefa
test

Swipe to show code editor

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 3. Capítulo 7
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt