Intermediate
Kotlin
Q90 / 100
What is Kotlin's buildString function?
Correct! Well done.
Incorrect.
The correct answer is B) A concise way to build a string using a StringBuilder with an apply-like DSL: buildString { append("Hello"); append(name) }
B
Correct Answer
A concise way to build a string using a StringBuilder with an apply-like DSL: buildString { append("Hello"); append(name) }
Explanation
buildString { append("Hello, "); append(name); append("!") } is equivalent to StringBuilder().apply { ... }.toString() but cleaner.
Progress
90/100