Nickname parser

Report a typo

We will implement a function for parsing first and last names from e-mail addresses. For example, if the user enters the e-mail [email protected] or [email protected], the result of the function should be a string of the following form: Jon Kirbi.
Remember, the first and last name separator can be "." or "_". Look at the code below – your task is to fill in code gaps at the specified locations using the material of the current topic.

Sample Input 1:

Sample Output 1:

Jon Kirbi
Write a program in Kotlin
fun parsingNickname(emailString: String): String {
val symbolsForNickname = Regex("") // fix this condition
val nicknameString = emailString.split("").first() // fix this condition
val (firstName, lastName ) = nicknameString.split(symbolsForNickname)
val nickname = // put your code here
return nickname
}
___

Create a free account to access the full topic