Creating a Tag Builder

Report a typo

You are given the builderString function. Write the builder function to create a <tag></tag> HTML element.

Sample Input 1:

Kotlin

Sample 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)
}
___

Create a free account to access the full topic