You are given the builderString function. Write the builder function to create a <tag></tag> HTML element.
Lambda with receiver
Creating a Tag Builder
Report a typo
Sample Input 1:
KotlinSample Output 1:
<tag>Kotlin</tag>Write a program in Kotlin
/* Do not change code below */
fun builderString(
builder: StringBuilder.(String) -> Unit
): String {
val stringBuilder = StringBuilder()
stringBuilder.builder("")
return stringBuilder.toString()
}
fun main() {
val a = readln()
val res = builderString {
// write your code here
}
println(res)
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.