Kotlinlearncs.online LogoJava
Return to List

Solve: Last Chars

Imported By: Geoffrey Challen
/ Version: 2021.5.0

Given 2 Strings, first and second, return a new String made of the first character of first and the last character of second. So "yo" and "kotlin" yields "yn". If either string is length 0, use '@' for its missing char.

fun lastChars(
first: String,
second: String,
): String {
return "" // You may need to remove this starter code
}

Related Lessons

Stuck? You may find these lessons helpful: